Merge pull request #7426 from s-hadinger/rotary_iram

Add LightPowerIRAM() for rotary interrupt handler
This commit is contained in:
Theo Arends 2020-01-03 18:05:30 +01:00 committed by GitHub
commit 07d79f3076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -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
*/

View File

@ -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