From: Jim Morris Date: Wed, 28 Dec 2016 01:00:35 +0000 (-0800) Subject: Change G4 Pxxx in grbl mode to be float seconds not milliseconds to be compatible... X-Git-Url: http://git.hcoop.net/clinton/Smoothieware.git/commitdiff_plain/df0783b73618fbf9170e20413ec0fb6454aefff1 Change G4 Pxxx in grbl mode to be float seconds not milliseconds to be compatible with grbl and linuxcnc. No change when in 3d printer mode. --- diff --git a/src/modules/robot/Robot.cpp b/src/modules/robot/Robot.cpp index 6503a972..141379f7 100644 --- a/src/modules/robot/Robot.cpp +++ b/src/modules/robot/Robot.cpp @@ -421,10 +421,18 @@ void Robot::on_gcode_received(void *argument) case 1: motion_mode = LINEAR; break; case 2: motion_mode = CW_ARC; break; case 3: motion_mode = CCW_ARC; break; - case 4: { // G4 pause + case 4: { // G4 Dwell uint32_t delay_ms = 0; if (gcode->has_letter('P')) { - delay_ms = gcode->get_int('P'); + if(THEKERNEL->is_grbl_mode()) { + // in grbl mode (and linuxcnc) P is decimal seconds + float f= gcode->get_value('P'); + delay_ms= f * 1000.0F; + + }else{ + // in reprap P is milliseconds, they always have to be different! + delay_ms = gcode->get_int('P'); + } } if (gcode->has_letter('S')) { delay_ms += gcode->get_int('S') * 1000;