Browse Source

Move M0_M1 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
04583d46af
  1. 4
      Marlin/src/Marlin.cpp
  2. 3
      Marlin/src/gcode/gcode.cpp
  3. 19
      Marlin/src/gcode/lcd/M0_M1.cpp

4
Marlin/src/Marlin.cpp

@ -357,10 +357,6 @@ void suicide() {
***************** GCode Handlers *****************
**************************************************/
#if HAS_RESUME_CONTINUE
#include "gcode/lcd/M0_M1.h"
#endif
#if ENABLED(SPINDLE_LASER_ENABLE)
#include "gcode/control/M3-M5.h"
#endif

3
Marlin/src/gcode/gcode.cpp

@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
//
// Placeholders for non-migrated codes
//
extern void gcode_M0_M1();
extern void gcode_M3_M4(bool is_M3);
extern void gcode_M5();
extern void gcode_M17();
@ -413,7 +412,7 @@ void GcodeSuite::process_next_command() {
#if HAS_RESUME_CONTINUE
case 0: // M0: Unconditional stop - Wait for user button press on LCD
case 1: // M1: Conditional stop - Wait for user button press on LCD
gcode_M0_M1();
M0_M1();
break;
#endif // ULTIPANEL

19
Marlin/src/gcode/lcd/M0_M1.h → Marlin/src/gcode/lcd/M0_M1.cpp

@ -20,13 +20,24 @@
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_RESUME_CONTINUE
#include "../gcode.h"
#include "../../module/stepper.h"
#if ENABLED(ULTIPANEL)
#include "../../lcd/ultralcd.h"
#endif
#include "../../sd/cardreader.h"
/**
* M0: Unconditional stop - Wait for user button press on LCD
* M1: Conditional stop - Wait for user button press on LCD
*/
void gcode_M0_M1() {
void GcodeSuite::M0_M1() {
const char * const args = parser.string_arg;
millis_t ms = 0;
@ -64,10 +75,10 @@ void gcode_M0_M1() {
wait_for_user = true;
stepper.synchronize();
gcode.refresh_cmd_timeout();
refresh_cmd_timeout();
if (ms > 0) {
ms += gcode.previous_cmd_ms; // wait until this time for a click
ms += previous_cmd_ms; // wait until this time for a click
while (PENDING(millis(), ms) && wait_for_user) idle();
}
else {
@ -84,3 +95,5 @@ void gcode_M0_M1() {
wait_for_user = false;
KEEPALIVE_STATE(IN_HANDLER);
}
#endif // HAS_RESUME_CONTINUE
Loading…
Cancel
Save