From 22d7fed60aa72937786e88196854c5983c98501d Mon Sep 17 00:00:00 2001 From: Ludy Date: Sun, 18 Nov 2018 04:13:36 +0100 Subject: [PATCH] Fix compile error with SD_FIRMWARE_UPDATE (#12462) --- Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp | 4 ++-- Marlin/src/HAL/shared/persistent_store_api.cpp | 2 +- Marlin/src/core/utility.cpp | 4 ++-- Marlin/src/core/utility.h | 2 +- Marlin/src/module/configuration_store.cpp | 5 ++++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp index c129226bb0..99b18001ad 100644 --- a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp @@ -23,7 +23,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) #include "../shared/persistent_store_api.h" @@ -64,5 +64,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t size_t PersistentStore::capacity() { return E2END + 1; } -#endif // EEPROM_SETTINGS +#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE #endif // __AVR__ diff --git a/Marlin/src/HAL/shared/persistent_store_api.cpp b/Marlin/src/HAL/shared/persistent_store_api.cpp index 50adc12631..230a70e85b 100644 --- a/Marlin/src/HAL/shared/persistent_store_api.cpp +++ b/Marlin/src/HAL/shared/persistent_store_api.cpp @@ -22,7 +22,7 @@ */ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) #include "persistent_store_api.h" PersistentStore persistentStore; diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 2de763b570..041c61b1ea 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -35,7 +35,7 @@ void safe_delay(millis_t ms) { thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made } -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) void crc16(uint16_t *crc, const void * const data, uint16_t cnt) { uint8_t *ptr = (uint8_t *)data; @@ -46,7 +46,7 @@ void safe_delay(millis_t ms) { } } -#endif // EEPROM_SETTINGS +#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE #if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI) diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 8122c3b5ad..324028a96f 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -27,7 +27,7 @@ constexpr char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' }; void safe_delay(millis_t ms); -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) void crc16(uint16_t *crc, const void * const data, uint16_t cnt); #endif diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 0844b8af66..2da6ea3eb2 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -66,6 +66,10 @@ #include "../gcode/gcode.h" #include "../Marlin.h" +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) + #include "../HAL/shared/persistent_store_api.h" +#endif + #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" #endif @@ -381,7 +385,6 @@ void MarlinSettings::postprocess() { #endif // SD_FIRMWARE_UPDATE #if ENABLED(EEPROM_SETTINGS) - #include "../HAL/shared/persistent_store_api.h" #define EEPROM_START() int eeprom_index = EEPROM_OFFSET; persistentStore.access_start() #define EEPROM_FINISH() persistentStore.access_finish()