From f4ca082f38f8383fb1e7e78fad8b75fcbb118be6 Mon Sep 17 00:00:00 2001 From: Terje Io Date: Wed, 22 Jan 2025 08:43:57 +0100 Subject: [PATCH] Guarded new code that caused compilation failure if `COMPATIBILITY_LEVEL` was set > 1. --- changelog.md | 24 ++++++++++++++++++++++++ gcode.c | 4 ++-- settings.c | 3 ++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 3fddbc6..b09b65a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,29 @@ ## grblHAL changelog +20250122 + +Core: + +* Guarded new code that caused compilation failure if `COMPATIBILITY_LEVEL` was set > 1. + +Drivers: + +* iMXRT1062: moved MCP3221 I2C ADC code to its correct home, fixes issue with it sometimes not beeing available for claiming by plugins. + +* RP2040: fixed generic map.Ref. issue [#108](https://github.com/grblHAL/RP2040/discussions/108). + +* STM32F1xx: fixed I2C strobe handling used by keypad plugin. + +* STM32F7xx: fix for error beeing reported when setting RTC clock. + +Plugins: + +* Networking: updated WizNet code to support lwIP version >= 2.2.0 for mDNS. Ref. issue [#109](https://github.com/grblHAL/RP2040/issues/109). + +* Plasma: fixed regression preventing visibility of some settings. Ref. issue [#17](https://github.com/grblHAL/Plugin_plasma/issues/17). + +--- + Build 20250120 Core: diff --git a/gcode.c b/gcode.c index 916d8ed..ac1561f 100644 --- a/gcode.c +++ b/gcode.c @@ -1362,7 +1362,7 @@ status_code_t gc_execute_block (char *block) case 63: case 64: case 65: - if(ioports_unclaimed(Port_Digital, Port_Output) == 0) + if(hal.port.digital_out == NULL || hal.port.num_digital_out == 0) FAIL(Status_GcodeUnsupportedCommand); // [Unsupported M command] word_bit.modal_group.M5 = On; port_command = (io_mcode_t)int_value; @@ -1936,7 +1936,7 @@ status_code_t gc_execute_block (char *block) FAIL(Status_GcodeValueWordMissing); if(gc_block.values.p < 0.0f) FAIL(Status_NegativeValue); - if((uint32_t)gc_block.values.p + 1 > ioports_unclaimed(Port_Digital, Port_Output)) + if((uint32_t)gc_block.values.p + 1 > hal.port.num_digital_out) FAIL(Status_GcodeValueOutOfRange); gc_block.output_command.is_digital = true; gc_block.output_command.port = (uint8_t)gc_block.values.p; diff --git a/settings.c b/settings.c index 30e2d79..3ac80ee 100644 --- a/settings.c +++ b/settings.c @@ -2547,11 +2547,12 @@ void settings_restore (settings_restore_t restore) if(restore.parameters) { float coord_data[N_AXIS]; memset(coord_data, 0, sizeof(coord_data)); +#if COMPATIBILITY_LEVEL <= 1 for(idx = 0; idx <= N_WorkCoordinateSystems; idx++) { if(idx < CoordinateSystem_G59_1 || idx > CoordinateSystem_G59_3 || bit_isfalse(settings.offset_lock.mask, bit(idx - CoordinateSystem_G59_1))) settings_write_coord_data((coord_system_id_t)idx, &coord_data); } - +#endif settings_write_coord_data(CoordinateSystem_G92, &coord_data); // Clear G92 offsets #if N_TOOLS