Move G4 to cpp

This commit is contained in:
Scott Lahteine 2017-09-15 21:17:34 -05:00
parent 4007cbfe9e
commit 760f29a88e
4 changed files with 8 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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