From c7c8cfed6f8987ff466e537a338195a6b5d8882e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jul 2015 17:20:02 -0700 Subject: [PATCH 1/3] Complete M200 output with M503 - The contents of EEPROM include filament diameters even with Volumetric disabled. This change makes `M503` display the full volumetric settings so that playing back the output of `M503 S0` will fully restore them. --- Marlin/configuration_store.cpp | 64 +++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 559cda0130..718afc2e92 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -826,39 +826,45 @@ void Config_PrintSettings(bool forReplay) { #endif // FWRETRACT - if (volumetric_enabled) { - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Filament settings:"); - } - + /** + * Volumetric extrusion M200 + */ + if (!forReplay) { CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 D", filament_size[0]); - SERIAL_EOL; - - #if EXTRUDERS > 1 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]); + SERIAL_ECHOPGM("Filament settings:"); + if (volumetric_enabled) SERIAL_EOL; - #if EXTRUDERS > 2 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]); - SERIAL_EOL; - #if EXTRUDERS > 3 - CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]); - SERIAL_EOL; - #endif - #endif - #endif - - } else { - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Filament settings: Disabled"); - } + else + SERIAL_ECHOLNPGM(" Disabled"); } + CONFIG_ECHO_START; + SERIAL_ECHOPAIR(" M200 D", filament_size[0]); + SERIAL_EOL; + #if EXTRUDERS > 1 + CONFIG_ECHO_START; + SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]); + SERIAL_EOL; + #if EXTRUDERS > 2 + CONFIG_ECHO_START; + SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]); + SERIAL_EOL; + #if EXTRUDERS > 3 + CONFIG_ECHO_START; + SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]); + SERIAL_EOL; + #endif + #endif + #endif + + if (!volumetric_enabled) { + CONFIG_ECHO_START; + SERIAL_ECHOLNPGM(" M200 D0"); + } + + /** + * Auto Bed Leveling + */ #ifdef ENABLE_AUTO_BED_LEVELING #ifdef CUSTOM_M_CODES if (!forReplay) { From ae9274be054e4876120345e23d8c04565730fa54 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jul 2015 17:20:53 -0700 Subject: [PATCH 2/3] Fix minor compiler warnings in for loops --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 404edb882c..4395ca3493 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3082,7 +3082,7 @@ inline void gcode_M42() { if (code_seen('P') && pin_status >= 0 && pin_status <= 255) pin_number = code_value_short(); - for (int8_t i = 0; i < COUNT(sensitive_pins); i++) { + for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) { if (sensitive_pins[i] == pin_number) { pin_number = -1; break; @@ -4222,7 +4222,7 @@ inline void gcode_M226() { if (pin_state >= -1 && pin_state <= 1) { - for (int8_t i = 0; i < COUNT(sensitive_pins); i++) { + for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) { if (sensitive_pins[i] == pin_number) { pin_number = -1; break; From 70be61d416cbfd09369459eae41c21ae2202d93d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jul 2015 18:08:06 -0700 Subject: [PATCH 3/3] Reset filament_size with a loop --- Marlin/configuration_store.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 718afc2e92..e7da52b09f 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -565,16 +565,8 @@ void Config_ResetDefault() { #endif volumetric_enabled = false; - filament_size[0] = DEFAULT_NOMINAL_FILAMENT_DIA; - #if EXTRUDERS > 1 - filament_size[1] = DEFAULT_NOMINAL_FILAMENT_DIA; - #if EXTRUDERS > 2 - filament_size[2] = DEFAULT_NOMINAL_FILAMENT_DIA; - #if EXTRUDERS > 3 - filament_size[3] = DEFAULT_NOMINAL_FILAMENT_DIA; - #endif - #endif - #endif + for (int q=0; q