Selaa lähdekoodia

Move M140, M190 to cpp

Scott Lahteine 7 vuotta sitten
vanhempi
commit
7479ff98b7

+ 0
- 6
Marlin/src/Marlin.cpp Näytä tiedosto

@@ -374,10 +374,6 @@ bool pin_is_protected(const int8_t pin) {
374 374
   return false;
375 375
 }
376 376
 
377
-#if HAS_TEMP_BED
378
-  #include "gcode/temperature/M190.h"
379
-#endif
380
-
381 377
 #include "gcode/host/M110.h"
382 378
 
383 379
 #include "gcode/control/M111.h"
@@ -397,8 +393,6 @@ bool pin_is_protected(const int8_t pin) {
397 393
   #endif
398 394
 #endif
399 395
 
400
-#include "gcode/temperature/M140.h"
401
-
402 396
 #if ENABLED(ULTIPANEL)
403 397
   #include "gcode/lcd/M145.h"
404 398
 #endif

+ 4
- 12
Marlin/src/gcode/gcode.cpp Näytä tiedosto

@@ -138,14 +138,12 @@ extern void gcode_M126();
138 138
 extern void gcode_M127();
139 139
 extern void gcode_M128();
140 140
 extern void gcode_M129();
141
-extern void gcode_M140();
142 141
 extern void gcode_M145();
143 142
 extern void gcode_M149();
144 143
 extern void gcode_M150();
145 144
 extern void gcode_M163();
146 145
 extern void gcode_M164();
147 146
 extern void gcode_M165();
148
-extern void gcode_M190();
149 147
 extern void gcode_M201();
150 148
 extern void gcode_M203();
151 149
 extern void gcode_M204();
@@ -470,10 +468,10 @@ void GcodeSuite::process_next_command() {
470 468
           break;
471 469
       #endif
472 470
 
473
-      case 140: // M140: Set bed temperature
474
-        gcode_M140();
475
-        break;
476
-
471
+      #if HAS_HEATER_BED && HAS_TEMP_BED
472
+        case 140: M140(); break;  // M140: Set bed temperature
473
+        case 190: M190(); break;  // M190: Wait for bed temperature to reach target
474
+      #endif
477 475
 
478 476
       case 105: // M105: Report current temperature
479 477
         M105();
@@ -484,12 +482,6 @@ void GcodeSuite::process_next_command() {
484 482
         case 155: M155(); break;  // M155: Set temperature auto-report interval
485 483
       #endif
486 484
 
487
-      #if HAS_TEMP_BED
488
-        case 190: // M190: Wait for bed temperature to reach target
489
-          gcode_M190();
490
-          break;
491
-      #endif // HAS_TEMP_BED
492
-
493 485
       #if FAN_COUNT > 0
494 486
         case 106: M106(); break;  // M106: Fan On
495 487
         case 107: M107(); break;  // M107: Fan Off

+ 2
- 5
Marlin/src/gcode/gcode.h Näytä tiedosto

@@ -502,8 +502,9 @@ private:
502 502
     #endif
503 503
   #endif
504 504
 
505
-  #if HAS_TEMP_BED
505
+  #if HAS_HEATER_BED && HAS_TEMP_BED
506 506
     static void M140();
507
+    static void M190();
507 508
   #endif
508 509
 
509 510
   #if ENABLED(ULTIPANEL)
@@ -532,10 +533,6 @@ private:
532 533
     #endif
533 534
   #endif
534 535
 
535
-  #if HAS_TEMP_BED
536
-    static void M190();
537
-  #endif
538
-
539 536
   static void M200();
540 537
   static void M201();
541 538
 

Marlin/src/gcode/temperature/M140.h → Marlin/src/gcode/temperature/M140.cpp Näytä tiedosto

@@ -20,10 +20,19 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_HEATER_BED && HAS_TEMP_BED
26
+
27
+#include "../gcode.h"
28
+#include "../../module/temperature.h"
29
+
23 30
 /**
24 31
  * M140: Set bed temperature
25 32
  */
26
-void gcode_M140() {
33
+void GcodeSuite::M140() {
27 34
   if (DEBUGGING(DRYRUN)) return;
28 35
   if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius());
29 36
 }
37
+
38
+#endif // HAS_HEATER_BED && HAS_TEMP_BED

Marlin/src/gcode/temperature/M190.h → Marlin/src/gcode/temperature/M190.cpp Näytä tiedosto

@@ -20,7 +20,24 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_HEATER_BED && HAS_TEMP_BED
26
+
23 27
 #include "../gcode.h"
28
+#include "../../module/motion.h"
29
+#include "../../module/temperature.h"
30
+#include "../../lcd/ultralcd.h"
31
+
32
+#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
33
+  #include "../../module/printcounter.h"
34
+#endif
35
+
36
+#if ENABLED(PRINTER_EVENT_LEDS)
37
+  #include "../../feature/leds/leds.h"
38
+#endif
39
+
40
+#include "../../Marlin.h" // for wait_for_heatup and idle()
24 41
 
25 42
 #ifndef MIN_COOLING_SLOPE_DEG_BED
26 43
   #define MIN_COOLING_SLOPE_DEG_BED 1.50
@@ -33,7 +50,7 @@
33 50
  * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
34 51
  *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
35 52
  */
36
-void gcode_M190() {
53
+void GcodeSuite::M190() {
37 54
   if (DEBUGGING(DRYRUN)) return;
38 55
 
39 56
   LCD_MESSAGEPGM(MSG_BED_HEATING);
@@ -65,7 +82,7 @@ void gcode_M190() {
65 82
     KEEPALIVE_STATE(NOT_BUSY);
66 83
   #endif
67 84
 
68
-  gcode.target_extruder = active_extruder; // for print_heaterstates
85
+  target_extruder = active_extruder; // for print_heaterstates
69 86
 
70 87
   #if ENABLED(PRINTER_EVENT_LEDS)
71 88
     const float start_temp = thermalManager.degBed();
@@ -97,7 +114,7 @@ void gcode_M190() {
97 114
     }
98 115
 
99 116
     idle();
100
-    gcode.refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out
117
+    refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out
101 118
 
102 119
     const float temp = thermalManager.degBed();
103 120
 
@@ -149,3 +166,5 @@ void gcode_M190() {
149 166
     KEEPALIVE_STATE(IN_HANDLER);
150 167
   #endif
151 168
 }
169
+
170
+#endif // HAS_HEATER_BED && HAS_TEMP_BED

Loading…
Peruuta
Tallenna