From 7b629124f7a255d074d455eea4afe62c7215366c Mon Sep 17 00:00:00 2001 From: Rob Giseburt Date: Wed, 12 Apr 2017 20:24:58 -0500 Subject: [PATCH] Marlin: fix M4 to be in milliseconds for Marlin flavor gcode --- g2core/gcode_parser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/g2core/gcode_parser.cpp b/g2core/gcode_parser.cpp index 2005f9e9..78cc2f18 100644 --- a/g2core/gcode_parser.cpp +++ b/g2core/gcode_parser.cpp @@ -1096,6 +1096,14 @@ static stat_t _execute_gcode_block_marlin() cm.gm.tool = cm.gm.tool_select; // Also, in Marlin, tool changes are effective immediately :facepalm: } + if (mst.marlin_flavor && + (gv.next_action == NEXT_ACTION_DWELL) && + gf.P_word + ) + { // G4 - dwell - adjust for Marlin + gv.P_word = gv.P_word / 1000.0; // In marlin, the P word is in microseconds, convert to seconds + } + // Deal with E if (gf.marlin_relative_extruder_mode) { // M82, M83 marlin_set_extruder_mode(gv.marlin_relative_extruder_mode);