Move M18_M84, M85 to cpp

This commit is contained in:
Scott Lahteine 2017-09-16 23:57:09 -05:00
parent a911215b0e
commit 381b17e6a9
6 changed files with 21 additions and 18 deletions

View File

@ -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)

View File

@ -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

View File

@ -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();
} }

View File

@ -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();
} }

View File

@ -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;

View File

@ -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)();