diff --git a/gcode.c b/gcode.c index de2fef3..bf15363 100644 --- a/gcode.c +++ b/gcode.c @@ -1821,9 +1821,10 @@ status_code_t gc_execute_block(char *block, char *message) FAIL(Status_NonPositiveValue); // [L <= 0] if(value_words.r) - gc_state.canned.retract_position = gc_block.values.r + (gc_block.modal.distance_incremental - ? gc_state.position[plane.axis_linear] - : gc_get_block_offset(&gc_block, plane.axis_linear)); + gc_state.canned.retract_position = gc_block.values.r * (gc_block.modal.units_imperial ? MM_PER_INCH : 1.0f) + + (gc_block.modal.distance_incremental + ? gc_state.position[plane.axis_linear] + : gc_get_block_offset(&gc_block, plane.axis_linear)); idx = N_AXIS; do { @@ -1871,7 +1872,7 @@ status_code_t gc_execute_block(char *block, char *message) if(value_words.q) { if(gc_block.values.q <= 0.0f) FAIL(Status_NegativeValue); // [Q <= 0] - gc_state.canned.delta = gc_block.values.q; + gc_state.canned.delta = gc_block.values.q * (gc_block.modal.units_imperial ? MM_PER_INCH : 1.0f); value_words.q = Off; // Remove single-meaning value word. } else if(gc_parser_flags.canned_cycle_change) FAIL(Status_GcodeValueWordMissing); diff --git a/grbl.h b/grbl.h index b852281..60a7297 100644 --- a/grbl.h +++ b/grbl.h @@ -34,7 +34,7 @@ #else #define GRBL_VERSION "1.1f" #endif -#define GRBL_VERSION_BUILD "20210513" +#define GRBL_VERSION_BUILD "20210517" // The following symbols are set here if not already set by the compiler or in config.h // Do NOT change here!