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
   return false;
374
   return false;
375
 }
375
 }
376
 
376
 
377
-#if HAS_TEMP_BED
378
-  #include "gcode/temperature/M190.h"
379
-#endif
380
-
381
 #include "gcode/host/M110.h"
377
 #include "gcode/host/M110.h"
382
 
378
 
383
 #include "gcode/control/M111.h"
379
 #include "gcode/control/M111.h"
397
   #endif
393
   #endif
398
 #endif
394
 #endif
399
 
395
 
400
-#include "gcode/temperature/M140.h"
401
-
402
 #if ENABLED(ULTIPANEL)
396
 #if ENABLED(ULTIPANEL)
403
   #include "gcode/lcd/M145.h"
397
   #include "gcode/lcd/M145.h"
404
 #endif
398
 #endif

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

138
 extern void gcode_M127();
138
 extern void gcode_M127();
139
 extern void gcode_M128();
139
 extern void gcode_M128();
140
 extern void gcode_M129();
140
 extern void gcode_M129();
141
-extern void gcode_M140();
142
 extern void gcode_M145();
141
 extern void gcode_M145();
143
 extern void gcode_M149();
142
 extern void gcode_M149();
144
 extern void gcode_M150();
143
 extern void gcode_M150();
145
 extern void gcode_M163();
144
 extern void gcode_M163();
146
 extern void gcode_M164();
145
 extern void gcode_M164();
147
 extern void gcode_M165();
146
 extern void gcode_M165();
148
-extern void gcode_M190();
149
 extern void gcode_M201();
147
 extern void gcode_M201();
150
 extern void gcode_M203();
148
 extern void gcode_M203();
151
 extern void gcode_M204();
149
 extern void gcode_M204();
470
           break;
468
           break;
471
       #endif
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
       case 105: // M105: Report current temperature
476
       case 105: // M105: Report current temperature
479
         M105();
477
         M105();
484
         case 155: M155(); break;  // M155: Set temperature auto-report interval
482
         case 155: M155(); break;  // M155: Set temperature auto-report interval
485
       #endif
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
       #if FAN_COUNT > 0
485
       #if FAN_COUNT > 0
494
         case 106: M106(); break;  // M106: Fan On
486
         case 106: M106(); break;  // M106: Fan On
495
         case 107: M107(); break;  // M107: Fan Off
487
         case 107: M107(); break;  // M107: Fan Off

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

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

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

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
  * M140: Set bed temperature
31
  * M140: Set bed temperature
25
  */
32
  */
26
-void gcode_M140() {
33
+void GcodeSuite::M140() {
27
   if (DEBUGGING(DRYRUN)) return;
34
   if (DEBUGGING(DRYRUN)) return;
28
   if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius());
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
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_HEATER_BED && HAS_TEMP_BED
26
+
23
 #include "../gcode.h"
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
 #ifndef MIN_COOLING_SLOPE_DEG_BED
42
 #ifndef MIN_COOLING_SLOPE_DEG_BED
26
   #define MIN_COOLING_SLOPE_DEG_BED 1.50
43
   #define MIN_COOLING_SLOPE_DEG_BED 1.50
33
  * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
50
  * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
34
  *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
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
   if (DEBUGGING(DRYRUN)) return;
54
   if (DEBUGGING(DRYRUN)) return;
38
 
55
 
39
   LCD_MESSAGEPGM(MSG_BED_HEATING);
56
   LCD_MESSAGEPGM(MSG_BED_HEATING);
65
     KEEPALIVE_STATE(NOT_BUSY);
82
     KEEPALIVE_STATE(NOT_BUSY);
66
   #endif
83
   #endif
67
 
84
 
68
-  gcode.target_extruder = active_extruder; // for print_heaterstates
85
+  target_extruder = active_extruder; // for print_heaterstates
69
 
86
 
70
   #if ENABLED(PRINTER_EVENT_LEDS)
87
   #if ENABLED(PRINTER_EVENT_LEDS)
71
     const float start_temp = thermalManager.degBed();
88
     const float start_temp = thermalManager.degBed();
97
     }
114
     }
98
 
115
 
99
     idle();
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
     const float temp = thermalManager.degBed();
119
     const float temp = thermalManager.degBed();
103
 
120
 
149
     KEEPALIVE_STATE(IN_HANDLER);
166
     KEEPALIVE_STATE(IN_HANDLER);
150
   #endif
167
   #endif
151
 }
168
 }
169
+
170
+#endif // HAS_HEATER_BED && HAS_TEMP_BED

Loading…
Peruuta
Tallenna