mirror of
https://github.com/esphome/esphome.git
synced 2024-12-18 11:34:54 +01:00
[core] Move delay_microseconds_safe to iram (#7957)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
This commit is contained in:
parent
0fbe6c0d8b
commit
af23357dca
1 changed files with 2 additions and 1 deletions
|
@ -767,7 +767,8 @@ bool mac_address_is_valid(const uint8_t *mac) {
|
||||||
return !(is_all_zeros || is_all_ones);
|
return !(is_all_zeros || is_all_ones);
|
||||||
}
|
}
|
||||||
|
|
||||||
void delay_microseconds_safe(uint32_t us) { // avoids CPU locks that could trigger WDT or affect WiFi/BT stability
|
void IRAM_ATTR HOT delay_microseconds_safe(uint32_t us) {
|
||||||
|
// avoids CPU locks that could trigger WDT or affect WiFi/BT stability
|
||||||
uint32_t start = micros();
|
uint32_t start = micros();
|
||||||
|
|
||||||
const uint32_t lag = 5000; // microseconds, specifies the maximum time for a CPU busy-loop.
|
const uint32_t lag = 5000; // microseconds, specifies the maximum time for a CPU busy-loop.
|
||||||
|
|
Loading…
Reference in a new issue