Browse Source

Move G4 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
760f29a88e
  1. 2
      Marlin/src/Marlin.cpp
  2. 3
      Marlin/src/gcode/gcode.cpp
  3. 2
      Marlin/src/gcode/gcode.h
  4. 8
      Marlin/src/gcode/motion/G4.cpp

2
Marlin/src/Marlin.cpp

@ -365,8 +365,6 @@ void suicide() {
***************** GCode Handlers *****************
**************************************************/
#include "gcode/motion/G4.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "gcode/motion/G5.h"
#endif

3
Marlin/src/gcode/gcode.cpp

@ -112,7 +112,6 @@ void GcodeSuite::dwell(millis_t time) {
//
// Placeholders for non-migrated codes
//
extern void gcode_G4();
extern void gcode_G5();
extern void gcode_G12();
extern void gcode_G17();
@ -295,7 +294,7 @@ void GcodeSuite::process_next_command() {
// G4 Dwell
case 4:
gcode_G4();
G4();
break;
#if ENABLED(BEZIER_CURVE_SUPPORT)

2
Marlin/src/gcode/gcode.h

@ -299,7 +299,7 @@ public:
#define KEEPALIVE_STATE(n) NOOP
#endif
void dwell(millis_t time);
static void dwell(millis_t time);
private:

8
Marlin/src/gcode/motion/G4.h → Marlin/src/gcode/motion/G4.cpp

@ -20,10 +20,14 @@
*
*/
#include "../gcode.h"
#include "../../module/stepper.h"
#include "../../lcd/ultralcd.h"
/**
* G4: Dwell S<seconds> or P<milliseconds>
*/
void gcode_G4() {
void GcodeSuite::G4() {
millis_t dwell_ms = 0;
if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait
@ -33,5 +37,5 @@ void gcode_G4() {
if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL);
gcode.dwell(dwell_ms);
dwell(dwell_ms);
}
Loading…
Cancel
Save