Browse Source

Move M111 to cpp

Scott Lahteine 7 years ago
parent
commit
06f3c8029e
3 changed files with 5 additions and 8 deletions
  1. 0
    2
      Marlin/src/Marlin.cpp
  2. 4
    2
      Marlin/src/gcode/control/M111.cpp
  3. 1
    4
      Marlin/src/gcode/gcode.cpp

+ 0
- 2
Marlin/src/Marlin.cpp View File

@@ -374,8 +374,6 @@ bool pin_is_protected(const int8_t pin) {
374 374
   return false;
375 375
 }
376 376
 
377
-#include "gcode/control/M111.h"
378
-
379 377
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
380 378
   #include "gcode/host/M113.h"
381 379
 #endif

Marlin/src/gcode/control/M111.h → Marlin/src/gcode/control/M111.cpp View File

@@ -20,10 +20,12 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../gcode.h"
24
+
23 25
 /**
24 26
  * M111: Set the debug level
25 27
  */
26
-void gcode_M111() {
28
+void GcodeSuite::M111() {
27 29
   if (parser.seen('S')) marlin_debug_flags = parser.byteval('S');
28 30
 
29 31
   const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO,
@@ -50,7 +52,7 @@ void gcode_M111() {
50 52
     for (uint8_t i = 0; i < COUNT(debug_strings); i++) {
51 53
       if (TEST(marlin_debug_flags, i)) {
52 54
         if (comma++) SERIAL_CHAR(',');
53
-        serialprintPGM((char*)pgm_read_word(&debug_strings[i]));
55
+        serialprintPGM((char*)pgm_read_ptr(&debug_strings[i]));
54 56
       }
55 57
     }
56 58
   }

+ 1
- 4
Marlin/src/gcode/gcode.cpp View File

@@ -124,7 +124,6 @@ extern void gcode_M83();
124 124
 extern void gcode_M85();
125 125
 extern void gcode_M92();
126 126
 extern void gcode_M100();
127
-extern void gcode_M111();
128 127
 extern void gcode_M113();
129 128
 extern void gcode_M114();
130 129
 extern void gcode_M115();
@@ -449,9 +448,7 @@ void GcodeSuite::process_next_command() {
449 448
 
450 449
       case 110: M110(); break;    // M110: Set Current Line Number
451 450
 
452
-      case 111: // M111: Set debug level
453
-        gcode_M111();
454
-        break;
451
+      case 111: M111(); break;    // M111: Set debug level
455 452
 
456 453
       #if DISABLED(EMERGENCY_PARSER)
457 454
         case 108: M108(); break;  // M108: Cancel Waiting

Loading…
Cancel
Save