From bb5bb049a713034d5f2b75daccfc8431c1e63bf9 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 2 Feb 2024 23:40:20 -0700 Subject: enabled eeprom read/write stabilization by default on recent MCUs, to prevent corrupt data This was enabled on more build targets before, but the *_ENABLE_PIN definition names changed and the eeprom code didn't, so it was not compiled in for a few months on some lights which probably needed it. To fix that, it's now enabled by default on everything bigger than attiny85, since it doesn't really hurt anything if it's enabled when not needed. --- fsm/eeprom.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fsm/eeprom.c') diff --git a/fsm/eeprom.c b/fsm/eeprom.c index 8f8bd67..436a736 100644 --- a/fsm/eeprom.c +++ b/fsm/eeprom.c @@ -14,7 +14,7 @@ uint8_t eeprom[EEPROM_BYTES]; #endif uint8_t load_eeprom() { - #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN) + #ifdef USE_EEP_DELAY delay_4ms(2); // wait for power to stabilize #endif @@ -32,7 +32,7 @@ uint8_t load_eeprom() { } void save_eeprom() { - #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN) + #ifdef USE_EEP_DELAY delay_4ms(2); // wait for power to stabilize #endif @@ -54,7 +54,7 @@ uint8_t eeprom_wl[EEPROM_WL_BYTES]; uint8_t * eep_wl_prev_offset; uint8_t load_eeprom_wl() { - #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN) + #ifdef USE_EEP_DELAY delay_4ms(2); // wait for power to stabilize #endif @@ -83,7 +83,7 @@ uint8_t load_eeprom_wl() { } void save_eeprom_wl() { - #if defined(LED_ENABLE_PIN) || defined(LED2_ENABLE_PIN) + #ifdef USE_EEP_DELAY delay_4ms(2); // wait for power to stabilize #endif -- cgit v1.2.3