ESPHome 2026.5.0-dev
Loading...
Searching...
No Matches
esphome::HighFrequencyLoopRequester Class Reference

Helper class to request loop() to be called as fast as possible. More...

#include <helpers.h>

Public Member Functions

void start ()
 Start running the loop continuously.
 
void stop ()
 Stop running the loop continuously.
 

Static Public Member Functions

static bool is_high_frequency ()
 Check whether the loop is running continuously.
 

Protected Attributes

bool started_ {false}
 

Static Protected Attributes

static uint8_t num_requests = 0
 

Detailed Description

Helper class to request loop() to be called as fast as possible.

Usually the ESPHome main loop runs at 60 Hz, sleeping in between invocations of loop() if necessary. When a higher execution frequency is necessary, you can use this class to make the loop run continuously without waiting.

Definition at line 2145 of file helpers.h.

Member Function Documentation

◆ is_high_frequency()

static bool esphome::HighFrequencyLoopRequester::is_high_frequency ( )
inlinestatic

Check whether the loop is running continuously.

Definition at line 2153 of file helpers.h.

◆ start()

void esphome::HighFrequencyLoopRequester::start ( )

Start running the loop continuously.

Definition at line 841 of file helpers.cpp.

◆ stop()

void esphome::HighFrequencyLoopRequester::stop ( )

Stop running the loop continuously.

Definition at line 847 of file helpers.cpp.

Field Documentation

◆ num_requests

uint8_t esphome::HighFrequencyLoopRequester::num_requests = 0
staticprotected

Definition at line 2157 of file helpers.h.

◆ started_

bool esphome::HighFrequencyLoopRequester::started_ {false}
protected

Definition at line 2156 of file helpers.h.


The documentation for this class was generated from the following files: