From a4e1d83599f0daeabf7e7096e131b5c66b7bb017 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Dec 2017 21:16:00 -0600 Subject: [PATCH] Fix M503 S parameter --- Marlin/src/gcode/eeprom/M500-M503.cpp | 2 +- Marlin/src/module/configuration_store.cpp | 2 +- Marlin/src/module/configuration_store.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/eeprom/M500-M503.cpp b/Marlin/src/gcode/eeprom/M500-M503.cpp index 61f5aab4ae..45faa10179 100644 --- a/Marlin/src/gcode/eeprom/M500-M503.cpp +++ b/Marlin/src/gcode/eeprom/M500-M503.cpp @@ -51,7 +51,7 @@ void GcodeSuite::M502() { * M503: print settings currently in memory */ void GcodeSuite::M503() { - (void)settings.report(parser.boolval('S')); + (void)settings.report(parser.seen('S') && !parser.value_bool()); } #endif // !DISABLE_M503 diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 9caebff1ac..3eef0d8b3d 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -1527,7 +1527,7 @@ void MarlinSettings::reset() { * * Unless specifically disabled, M503 is available even without EEPROM */ - void MarlinSettings::report(bool forReplay) { + void MarlinSettings::report(const bool forReplay) { /** * Announce current units, in case inches are being displayed diff --git a/Marlin/src/module/configuration_store.h b/Marlin/src/module/configuration_store.h index 03c304d94a..e23b66a665 100644 --- a/Marlin/src/module/configuration_store.h +++ b/Marlin/src/module/configuration_store.h @@ -52,10 +52,10 @@ class MarlinSettings { #endif #if DISABLED(DISABLE_M503) - static void report(bool forReplay=false); + static void report(const bool forReplay=false); #else FORCE_INLINE - static void report(bool forReplay=false) { UNUSED(forReplay); } + static void report(const bool forReplay=false) { UNUSED(forReplay); } #endif private: