ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::UnavoidableBlockingScope Class Reference

Leaves a stretch of the current loop pass out of the blocking warning. More...

#include <application.h>

Public Member Functions

 UnavoidableBlockingScope ()
 
 ~UnavoidableBlockingScope ()
 
 UnavoidableBlockingScope (const UnavoidableBlockingScope &)=delete
 
UnavoidableBlockingScope & operator= (const UnavoidableBlockingScope &)=delete
 

Detailed Description

Leaves a stretch of the current loop pass out of the blocking warning.

Only for work that cannot be made shorter or split across passes: radio bring-up, a first network connect, a key generation. Work that could be cached, deferred, polled or turned into a state machine stays outside, so the warning keeps finding it.

Affects only work timed by LoopBlockingGuard: loop() and scheduler callbacks, not setup(). Main loop task only. The watchdog is not fed, so pair long work with watchdog::WatchdogManager. Scopes may nest. Afterwards App.get_loop_component_start_time() can be earlier than a millis() read taken before the scope; time the work with millis() at both ends.

UnavoidableBlockingScope scope; this->generate_key_();

Definition at line 651 of file application.h.

Constructor & Destructor Documentation

◆ UnavoidableBlockingScope() [1/2]

esphome::UnavoidableBlockingScope::UnavoidableBlockingScope ( )
inline

Definition at line 653 of file application.h.

◆ ~UnavoidableBlockingScope()

esphome::UnavoidableBlockingScope::~UnavoidableBlockingScope ( )
inline

Definition at line 654 of file application.h.

◆ UnavoidableBlockingScope() [2/2]

esphome::UnavoidableBlockingScope::UnavoidableBlockingScope ( const UnavoidableBlockingScope & )
delete

Member Function Documentation

◆ operator=()

UnavoidableBlockingScope & esphome::UnavoidableBlockingScope::operator= ( const UnavoidableBlockingScope & )
delete

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