Browse Source

Move M18_M84, M85 to cpp

Scott Lahteine 8 years ago
parent
commit
381b17e6a9

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

170
 #endif
170
 #endif
171
 
171
 
172
 // Inactivity shutdown
172
 // Inactivity shutdown
173
-static millis_t max_inactive_time = 0;
174
-static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
173
+millis_t max_inactive_time = 0,
174
+         stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
175
 
175
 
176
 #if ENABLED(Z_DUAL_ENDSTOPS)
176
 #if ENABLED(Z_DUAL_ENDSTOPS)
177
   float z_endstop_adj;
177
   float z_endstop_adj;
359
   return false;
359
   return false;
360
 }
360
 }
361
 
361
 
362
-#include "gcode/control/M18_M84.h"
363
-
364
-#include "gcode/control/M85.h"
365
-
366
 #include "gcode/config/M92.h"
362
 #include "gcode/config/M92.h"
367
 
363
 
368
 #if ENABLED(M100_FREE_MEMORY_WATCHER)
364
 #if ENABLED(M100_FREE_MEMORY_WATCHER)

+ 3
- 0
Marlin/src/Marlin.h View File

185
   linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);
185
   linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);
186
 #endif
186
 #endif
187
 
187
 
188
+// Inactivity shutdown timer
189
+extern millis_t max_inactive_time, stepper_inactive_time;
190
+
188
 #if ENABLED(Z_DUAL_ENDSTOPS)
191
 #if ENABLED(Z_DUAL_ENDSTOPS)
189
   extern float z_endstop_adj;
192
   extern float z_endstop_adj;
190
 #endif
193
 #endif

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

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../gcode.h"
24
+#include "../../Marlin.h" // for stepper_inactive_time
25
+#include "../../module/stepper.h"
26
+
23
 #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)
27
 #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)
24
-  extern bool defer_return_to_status;
28
+  #include "../../feature/bedlevel/bedlevel.h"
29
+  #include "../../lcd/ultralcd.h"
25
 #endif
30
 #endif
26
 
31
 
27
 /**
32
 /**
28
  * M18, M84: Disable stepper motors
33
  * M18, M84: Disable stepper motors
29
  */
34
  */
30
-void gcode_M18_M84() {
35
+void GcodeSuite::M18_M84() {
31
   if (parser.seenval('S')) {
36
   if (parser.seenval('S')) {
32
     stepper_inactive_time = parser.value_millis_from_seconds();
37
     stepper_inactive_time = parser.value_millis_from_seconds();
33
   }
38
   }

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

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../gcode.h"
24
+#include "../../Marlin.h" // for max_inactive_time
25
+
23
 /**
26
 /**
24
  * M85: Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
27
  * M85: Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
25
  */
28
  */
26
-void gcode_M85() {
29
+void GcodeSuite::M85() {
27
 
30
 
28
   if (parser.seen('S')) max_inactive_time = parser.value_millis_from_seconds();
31
   if (parser.seen('S')) max_inactive_time = parser.value_millis_from_seconds();
29
 
32
 
30
 }
33
 }
31
-

+ 3
- 8
Marlin/src/gcode/gcode.cpp View File

116
 //
116
 //
117
 // Placeholders for non-migrated codes
117
 // Placeholders for non-migrated codes
118
 //
118
 //
119
-extern void gcode_M18_M84();
120
-extern void gcode_M85();
121
 extern void gcode_M92();
119
 extern void gcode_M92();
122
 extern void gcode_M100();
120
 extern void gcode_M100();
123
 extern void gcode_M114();
121
 extern void gcode_M114();
497
       case 83: M83(); break;      // M83: Set E axis relative mode
495
       case 83: M83(); break;      // M83: Set E axis relative mode
498
 
496
 
499
       case 18: // M18 => M84
497
       case 18: // M18 => M84
500
-      case 84: // M84: Disable all steppers or set timeout
501
-        gcode_M18_M84();
502
-        break;
503
-      case 85: // M85: Set inactivity stepper shutdown timeout
504
-        gcode_M85();
505
-        break;
498
+      case 84: M18_M84(); break;  // M84: Disable all steppers or set timeout
499
+      case 85: M85(); break;      // M85: Set inactivity stepper shutdown timeout
500
+
506
       case 92: // M92: Set the steps-per-unit for one or more axes
501
       case 92: // M92: Set the steps-per-unit for one or more axes
507
         gcode_M92();
502
         gcode_M92();
508
         break;
503
         break;

+ 2
- 0
Marlin/src/lcd/ultralcd.h View File

80
 
80
 
81
   #if ENABLED(ULTIPANEL)
81
   #if ENABLED(ULTIPANEL)
82
 
82
 
83
+    extern bool defer_return_to_status;
84
+
83
     // Function pointer to menu functions.
85
     // Function pointer to menu functions.
84
     typedef void (*screenFunc_t)();
86
     typedef void (*screenFunc_t)();
85
 
87
 

Loading…
Cancel
Save