From 6fd01b5f6f189a15d0401cf1ecb336e3837858e8 Mon Sep 17 00:00:00 2001 From: Ludy <1@astra-g.org> Date: Fri, 16 Nov 2018 21:39:46 +0100 Subject: [PATCH 1/5] {Bugfix-2.0.x] uniform variable --- Marlin/src/gcode/temperature/M104_M109.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/src/gcode/temperature/M104_M109.cpp b/Marlin/src/gcode/temperature/M104_M109.cpp index 916c6efeebaf..39d65dc1a646 100644 --- a/Marlin/src/gcode/temperature/M104_M109.cpp +++ b/Marlin/src/gcode/temperature/M104_M109.cpp @@ -43,22 +43,22 @@ void GcodeSuite::M104() { if (DEBUGGING(DRYRUN)) return; #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - constexpr int8_t e = 0; + constexpr int8_t target_extruder = 0; #else - const int8_t e = get_target_extruder_from_command(); - if (e < 0) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; #endif if (parser.seenval('S')) { const int16_t temp = parser.value_celsius(); #if ENABLED(SINGLENOZZLE) - singlenozzle_temp[e] = temp; - if (e != active_extruder) return; + singlenozzle_temp[target_extruder] = temp; + if (target_extruder != active_extruder) return; #endif - thermalManager.setTargetHotend(temp, e); + thermalManager.setTargetHotend(temp, target_extruder); #if ENABLED(DUAL_X_CARRIAGE) - if (dxc_is_duplicating() && e == 0) + if (dxc_is_duplicating() && target_extruder == 0) thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); #endif From 6e09e6fbbfff5acefb896d066ed87a1d0ece47d3 Mon Sep 17 00:00:00 2001 From: Ludy <1@astra-g.org> Date: Sat, 17 Nov 2018 21:53:45 +0100 Subject: [PATCH 2/5] compile error SD_FIRMWARE_UPDATE --- 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 | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp index c129226bb017..46cba3e1cbd5 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 50adc12631ba..230a70e85b21 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 2de763b570e6..982aae37e0c6 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 8122c3b5ad5c..324028a96ffa 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 0844b8af667f..83a5b2047b5c 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -355,6 +355,7 @@ void MarlinSettings::postprocess() { } #if ENABLED(SD_FIRMWARE_UPDATE) + #include "../HAL/shared/persistent_store_api.h" #if ENABLED(EEPROM_SETTINGS) static_assert( From 40f3a426d25bc63bdf5678037efeb3cb5f9f533f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 17 Nov 2018 21:09:06 -0600 Subject: [PATCH 3/5] Update utility.cpp --- Marlin/src/core/utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 982aae37e0c6..041c61b1eabd 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -46,7 +46,7 @@ void safe_delay(millis_t ms) { } } -#endif // EEPROM_SETTINGS | SD_FIRMWARE_UPDATE +#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE #if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI) From 034d9bc727d7038bf5fa6bb7e513c78deb240087 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 17 Nov 2018 21:09:26 -0600 Subject: [PATCH 4/5] Update persistent_store_eeprom.cpp --- Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp index 46cba3e1cbd5..99b18001ad32 100644 --- a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp @@ -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 | SD_FIRMWARE_UPDATE +#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE #endif // __AVR__ From b7b638a1e767b442b93028a0ed8c6eb326295172 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 17 Nov 2018 21:11:41 -0600 Subject: [PATCH 5/5] Update configuration_store.cpp --- Marlin/src/module/configuration_store.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 83a5b2047b5c..2da6ea3eb25a 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 @@ -355,7 +359,6 @@ void MarlinSettings::postprocess() { } #if ENABLED(SD_FIRMWARE_UPDATE) - #include "../HAL/shared/persistent_store_api.h" #if ENABLED(EEPROM_SETTINGS) static_assert( @@ -382,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()