From 06f3c8029efff175fb70aa71184be4c1329ca292 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Sep 2017 22:40:04 -0500 Subject: [PATCH] Move M111 to cpp --- Marlin/src/Marlin.cpp | 2 -- Marlin/src/gcode/control/{M111.h => M111.cpp} | 6 ++++-- Marlin/src/gcode/gcode.cpp | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) rename Marlin/src/gcode/control/{M111.h => M111.cpp} (94%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 9db7d77c90..995c6bdd10 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -374,8 +374,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#include "gcode/control/M111.h" - #if ENABLED(HOST_KEEPALIVE_FEATURE) #include "gcode/host/M113.h" #endif diff --git a/Marlin/src/gcode/control/M111.h b/Marlin/src/gcode/control/M111.cpp similarity index 94% rename from Marlin/src/gcode/control/M111.h rename to Marlin/src/gcode/control/M111.cpp index 748796da65..1850ed2db8 100644 --- a/Marlin/src/gcode/control/M111.h +++ b/Marlin/src/gcode/control/M111.cpp @@ -20,10 +20,12 @@ * */ +#include "../gcode.h" + /** * M111: Set the debug level */ -void gcode_M111() { +void GcodeSuite::M111() { if (parser.seen('S')) marlin_debug_flags = parser.byteval('S'); const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO, @@ -50,7 +52,7 @@ void gcode_M111() { for (uint8_t i = 0; i < COUNT(debug_strings); i++) { if (TEST(marlin_debug_flags, i)) { if (comma++) SERIAL_CHAR(','); - serialprintPGM((char*)pgm_read_word(&debug_strings[i])); + serialprintPGM((char*)pgm_read_ptr(&debug_strings[i])); } } } diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 822c31786d..f9f508ffd1 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -124,7 +124,6 @@ extern void gcode_M83(); extern void gcode_M85(); extern void gcode_M92(); extern void gcode_M100(); -extern void gcode_M111(); extern void gcode_M113(); extern void gcode_M114(); extern void gcode_M115(); @@ -449,9 +448,7 @@ void GcodeSuite::process_next_command() { case 110: M110(); break; // M110: Set Current Line Number - case 111: // M111: Set debug level - gcode_M111(); - break; + case 111: M111(); break; // M111: Set debug level #if DISABLED(EMERGENCY_PARSER) case 108: M108(); break; // M108: Cancel Waiting