Browse Source

Move M18_M84, M85 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
381b17e6a9
  1. 8
      Marlin/src/Marlin.cpp
  2. 3
      Marlin/src/Marlin.h
  3. 9
      Marlin/src/gcode/control/M18_M84.cpp
  4. 6
      Marlin/src/gcode/control/M85.cpp
  5. 11
      Marlin/src/gcode/gcode.cpp
  6. 2
      Marlin/src/lcd/ultralcd.h

8
Marlin/src/Marlin.cpp

@ -170,8 +170,8 @@ volatile bool wait_for_heatup = true;
#endif #endif
// Inactivity shutdown // Inactivity shutdown
static millis_t max_inactive_time = 0; millis_t max_inactive_time = 0,
static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL; stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
#if ENABLED(Z_DUAL_ENDSTOPS) #if ENABLED(Z_DUAL_ENDSTOPS)
float z_endstop_adj; float z_endstop_adj;
@ -359,10 +359,6 @@ bool pin_is_protected(const int8_t pin) {
return false; return false;
} }
#include "gcode/control/M18_M84.h"
#include "gcode/control/M85.h"
#include "gcode/config/M92.h" #include "gcode/config/M92.h"
#if ENABLED(M100_FREE_MEMORY_WATCHER) #if ENABLED(M100_FREE_MEMORY_WATCHER)

3
Marlin/src/Marlin.h

@ -185,6 +185,9 @@ extern volatile bool wait_for_heatup;
linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int); linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);
#endif #endif
// Inactivity shutdown timer
extern millis_t max_inactive_time, stepper_inactive_time;
#if ENABLED(Z_DUAL_ENDSTOPS) #if ENABLED(Z_DUAL_ENDSTOPS)
extern float z_endstop_adj; extern float z_endstop_adj;
#endif #endif

9
Marlin/src/gcode/control/M18_M84.h → Marlin/src/gcode/control/M18_M84.cpp

@ -20,14 +20,19 @@
* *
*/ */
#include "../gcode.h"
#include "../../Marlin.h" // for stepper_inactive_time
#include "../../module/stepper.h"
#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD) #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)
extern bool defer_return_to_status; #include "../../feature/bedlevel/bedlevel.h"
#include "../../lcd/ultralcd.h"
#endif #endif
/** /**
* M18, M84: Disable stepper motors * M18, M84: Disable stepper motors
*/ */
void gcode_M18_M84() { void GcodeSuite::M18_M84() {
if (parser.seenval('S')) { if (parser.seenval('S')) {
stepper_inactive_time = parser.value_millis_from_seconds(); stepper_inactive_time = parser.value_millis_from_seconds();
} }

6
Marlin/src/gcode/control/M85.h → Marlin/src/gcode/control/M85.cpp

@ -20,12 +20,14 @@
* *
*/ */
#include "../gcode.h"
#include "../../Marlin.h" // for max_inactive_time
/** /**
* M85: Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default) * M85: Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
*/ */
void gcode_M85() { void GcodeSuite::M85() {
if (parser.seen('S')) max_inactive_time = parser.value_millis_from_seconds(); if (parser.seen('S')) max_inactive_time = parser.value_millis_from_seconds();
} }

11
Marlin/src/gcode/gcode.cpp

@ -116,8 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
// //
// Placeholders for non-migrated codes // Placeholders for non-migrated codes
// //
extern void gcode_M18_M84();
extern void gcode_M85();
extern void gcode_M92(); extern void gcode_M92();
extern void gcode_M100(); extern void gcode_M100();
extern void gcode_M114(); extern void gcode_M114();
@ -497,12 +495,9 @@ void GcodeSuite::process_next_command() {
case 83: M83(); break; // M83: Set E axis relative mode case 83: M83(); break; // M83: Set E axis relative mode
case 18: // M18 => M84 case 18: // M18 => M84
case 84: // M84: Disable all steppers or set timeout case 84: M18_M84(); break; // M84: Disable all steppers or set timeout
gcode_M18_M84(); case 85: M85(); break; // M85: Set inactivity stepper shutdown timeout
break;
case 85: // M85: Set inactivity stepper shutdown timeout
gcode_M85();
break;
case 92: // M92: Set the steps-per-unit for one or more axes case 92: // M92: Set the steps-per-unit for one or more axes
gcode_M92(); gcode_M92();
break; break;

2
Marlin/src/lcd/ultralcd.h

@ -80,6 +80,8 @@
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
extern bool defer_return_to_status;
// Function pointer to menu functions. // Function pointer to menu functions.
typedef void (*screenFunc_t)(); typedef void (*screenFunc_t)();

Loading…
Cancel
Save