diff --git a/src/boards.h b/src/boards.h index f399b01..040a928 100644 --- a/src/boards.h +++ b/src/boards.h @@ -33,6 +33,7 @@ #define WIRING_PWM_LEDS {} #define SUPPORT_EEPROM #define STAGE_MAX_MOTORS 3 + #define EEPROM_IS_REAL #elif defined(BOARD_SANGABOARDv2) #define BOARD_STRING "Sangaboard v0.2" #define WIRING_MOTOR_X 13, 12, 11, 10 @@ -47,6 +48,7 @@ #define WIRING_PWM_LEDS {} #define SUPPORT_EEPROM #define STAGE_MAX_MOTORS 3 + #define EEPROM_IS_REAL #elif defined(BOARD_CUSTOM_BLUEPILL) #define BOARD_STRING "Custom Bluepill board" #define WIRING_MOTOR_X PB11, PB10, PB1, PB0 diff --git a/src/modules/stage/stage.cpp b/src/modules/stage/stage.cpp index 6bf53c4..0efeb0e 100644 --- a/src/modules/stage/stage.cpp +++ b/src/modules/stage/stage.cpp @@ -194,7 +194,13 @@ void stage_loop() } } } + +#ifndef EEPROM_IS_REAL EEPROM.put(0, current_pos); // ensure our position is held in EEPROM so it persists +#else + if (!stage_moving) + EEPROM.put(0, current_pos); // ensure our position is held in EEPROM so it persists +#endif if (!stage_moving && notify_on_stop) {