ESPHome
2024.12.2
|
Helper class to disable interrupts. More...
#include <helpers.h>
Public Member Functions | |
InterruptLock () | |
~InterruptLock () | |
Protected Attributes | |
uint32_t | state_ |
Helper class to disable interrupts.
This behaves like std::lock_guard: as long as the object is alive, all interrupts are disabled.
Please note all functions called when the interrupt lock must be marked IRAM_ATTR (loading code into instruction cache is done via interrupts; disabling interrupts prevents data not already in cache from being pulled from flash).
Example usage:
IRAM_ATTR esphome::InterruptLock::InterruptLock | ( | ) |
Definition at line 657 of file helpers.cpp.
IRAM_ATTR esphome::InterruptLock::~InterruptLock | ( | ) |
Definition at line 658 of file helpers.cpp.