From 73604aa13c0b748a760d6f2e49c77830f38ce4f3 Mon Sep 17 00:00:00 2001 From: Terje Io Date: Thu, 21 May 2020 08:03:20 +0200 Subject: [PATCH] Some minor bug fixes Added missing G43 & G49 codes to parser state report $G. Fix for missing report of backlash settings, issue #47. --- grbl/report.c | 8 ++++++++ grbl/settings.h | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/grbl/report.c b/grbl/report.c index 8e15ecdf..f018e133 100644 --- a/grbl/report.c +++ b/grbl/report.c @@ -613,6 +613,14 @@ void report_gcode_modes (void) #if COMPATIBILITY_LEVEL < 10 + if(gc_state.modal.tool_offset_mode == ToolLengthOffset_Cancel) + hal.stream.write(" G49"); + else { + hal.stream.write(" G43"); + if(gc_state.modal.tool_offset_mode != ToolLengthOffset_Enable) + hal.stream.write(gc_state.modal.tool_offset_mode == ToolLengthOffset_EnableDynamic ? ".1" : ".2"); + } + hal.stream.write(gc_state.canned.retract_mode == CCRetractMode_RPos ? " G99" : " G98"); hal.stream.write(gc_state.modal.scaling_active ? " G51" : " G50"); diff --git a/grbl/settings.h b/grbl/settings.h index 1b56feb5..12a82729 100644 --- a/grbl/settings.h +++ b/grbl/settings.h @@ -2,7 +2,7 @@ settings.h - eeprom configuration handling Part of Grbl - Copyright (c) 2017-2019 Terje Io + Copyright (c) 2017-2020 Terje Io Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC Copyright (c) 2009-2011 Simen Svale Skogsrud @@ -78,7 +78,11 @@ typedef enum { #define N_COORDINATE_SYSTEMS (SettingIndex_NCoord - 3) // Number of supported work coordinate systems (from index 1) // Define Grbl axis settings numbering scheme. Starts at Setting_AxisSettingsBase, every INCREMENT, over N_SETTINGS. +#ifdef ENABLE_BACKLASH_COMPENSATION +#define AXIS_N_SETTINGS 6 +#else #define AXIS_N_SETTINGS 4 +#endif #define AXIS_SETTINGS_INCREMENT 10 // Must be greater than the number of axis settings TODO: change to 100 to allow for a logical wider range of parameters? typedef enum {