diff --git a/tasmota/support_rotary.ino b/tasmota/support_rotary.ino index cb6782da1..071b15b92 100644 --- a/tasmota/support_rotary.ino +++ b/tasmota/support_rotary.ino @@ -43,7 +43,7 @@ void update_rotary(void) ICACHE_RAM_ATTR; void update_rotary(void) { if (MI_DESK_LAMP == my_module_type) { - if (LightPower()) { + if (LightPowerIRAM()) { /* * https://github.com/PaulStoffregen/Encoder/blob/master/Encoder.h */ diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index 600642bfe..736d46e5a 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -277,6 +277,16 @@ power_t LightPower(void) return Light.power; // Make external } +// IRAM variant for rotary +#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception +power_t LightPowerIRAM(void) ICACHE_RAM_ATTR; +#endif // ARDUINO_ESP8266_RELEASE_2_3_0 + +power_t LightPowerIRAM(void) +{ + return Light.power; // Make external +} + uint8_t LightDevice(void) { return Light.device; // Make external