Improve dallas timing (#3181)

* Improve dallas timing

* Format
This commit is contained in:
Otto Winter
2022-02-11 09:06:06 +01:00
committed by GitHub
parent 72e716cdf1
commit 3a67884451
3 changed files with 149 additions and 96 deletions
+2
View File
@@ -328,6 +328,8 @@ void hsv_to_rgb(int hue, float saturation, float value, float &red, float &green
IRAM_ATTR InterruptLock::InterruptLock() { xt_state_ = xt_rsil(15); }
IRAM_ATTR InterruptLock::~InterruptLock() { xt_wsr_ps(xt_state_); }
#elif defined(USE_ESP32)
// only affects the executing core
// so should not be used as a mutex lock, only to get accurate timing
IRAM_ATTR InterruptLock::InterruptLock() { portDISABLE_INTERRUPTS(); }
IRAM_ATTR InterruptLock::~InterruptLock() { portENABLE_INTERRUPTS(); }
#endif