Guarded new code that caused compilation failure if COMPATIBILITY_LEVEL was set > 1.

This commit is contained in:
Terje Io
2025-01-22 08:43:57 +01:00
parent c7c7d5a4cf
commit f4ca082f38
3 changed files with 28 additions and 3 deletions

View File

@@ -1,5 +1,29 @@
## grblHAL changelog
<a name="20250122">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).
---
<a name="20250120">Build 20250120
Core:

View File

@@ -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;

View File

@@ -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