ESPHome  2024.7.2
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
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. More...
 
void stop ()
 Stop running the loop continuously. More...
 

Static Public Member Functions

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

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 609 of file helpers.h.

Member Function Documentation

◆ is_high_frequency()

bool esphome::HighFrequencyLoopRequester::is_high_frequency ( )
static

Check whether the loop is running continuously.

Definition at line 660 of file helpers.cpp.

◆ start()

void esphome::HighFrequencyLoopRequester::start ( )

Start running the loop continuously.

Definition at line 648 of file helpers.cpp.

◆ stop()

void esphome::HighFrequencyLoopRequester::stop ( )

Stop running the loop continuously.

Definition at line 654 of file helpers.cpp.

Field Documentation

◆ num_requests

uint8_t esphome::HighFrequencyLoopRequester::num_requests = 0
staticprotected

Definition at line 621 of file helpers.h.

◆ started_

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

Definition at line 620 of file helpers.h.


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