diff --git a/tasmota/support_rotary.ino b/tasmota/support_rotary.ino index a30cc02e3..9a8c95a83 100644 --- a/tasmota/support_rotary.ino +++ b/tasmota/support_rotary.ino @@ -180,8 +180,8 @@ void RotaryHandler(void) { Encoder[index].position = rotary_offset; interrupts(); - if (Settings.save_data && (save_data_counter < 2)) { - save_data_counter = 3; // Postpone flash writes while rotary is turned + if (Settings.save_data && (TasmotaGlobal.save_data_counter < 2)) { + TasmotaGlobal.save_data_counter = 3; // Postpone flash writes while rotary is turned } bool button_pressed = (Button.hold_timer[index]); // Button is pressed: set color temperature diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index 478ddde16..372022eb2 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -2134,9 +2134,9 @@ bool LightApplyFade(void) { // did the value chanegd and needs to be applied if (Settings.save_data) { // Also postpone the save_data for the duration of the Fade (in seconds) uint32_t delay_seconds = 1 + (Light.fade_duration + 999) / 1000; // add one more second - // AddLog_P2(LOG_LEVEL_INFO, PSTR("delay_seconds %d, save_data_counter %d"), delay_seconds, save_data_counter); - if (save_data_counter < delay_seconds) { - save_data_counter = delay_seconds; // pospone + // AddLog_P2(LOG_LEVEL_INFO, PSTR("delay_seconds %d, save_data_counter %d"), delay_seconds, TasmotaGlobal.save_data_counter); + if (TasmotaGlobal.save_data_counter < delay_seconds) { + TasmotaGlobal.save_data_counter = delay_seconds; // pospone } } } else {