Fix for hardfault due to recent control pins handling change - affects at least RP2040/RP2350 MCUs.

No longer outputs settings/settings data for $14 (inversion) and $17 (pullup disable) if no control inputs are configured.
This commit is contained in:
Terje Io
2025-06-11 22:37:53 +02:00
parent c038c92d34
commit 596576763e
5 changed files with 21 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
## grblHAL ##
Latest build date is 20250604, see the [changelog](changelog.md) for details.
Latest build date is 20250611, see the [changelog](changelog.md) for details.
> [!NOTE]
> A settings reset will be performed on an update of builds prior to 20241208. Backup and restore of settings is recommended.
+10
View File
@@ -1,5 +1,15 @@
## grblHAL changelog
<a name="20250611">Build 20250611
Core:
* Fix for hardfault due to recent control pins handling change - affects at least RP2040/RP2350 MCUs.
* No longer outputs settings/settings data for `$14` \(inversion\) and `$17` \(pullup disable\) if no control inputs are configured.
---
<a name="20250609">Build 20250609
Core:
+1 -1
View File
@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20250609
#define GRBL_BUILD 20250611
#define GRBL_URL "https://github.com/grblHAL"
+2 -1
View File
@@ -250,11 +250,12 @@ static inline aux_ctrl_t *aux_ctrl_remap_explicit (void *port, uint8_t pin, uint
uint_fast8_t idx;
for(idx = 0; ctrl_pin == NULL && aux_ctrl[idx].pin != 0xFF && idx < sizeof(aux_ctrl) / sizeof(aux_ctrl_t); idx++) {
for(idx = 0; ctrl_pin == NULL && idx < sizeof(aux_ctrl) / sizeof(aux_ctrl_t) && aux_ctrl[idx].pin != 0xFF; idx++) {
if(aux_ctrl[idx].pin == pin && aux_ctrl[idx].port == port) {
ctrl_pin = &aux_ctrl[idx];
ctrl_pin->aux_port = aux_port;
ctrl_pin->input = input;
break;
}
}
}
+7 -2
View File
@@ -1857,6 +1857,11 @@ static bool is_setting_available (const setting_detail_t *setting, uint_fast16_t
available = hal.driver_cap.pwm_spindle && spindle_get_caps(false).laser;
break;
case Setting_ControlInvertMask:
case Setting_ControlPullUpDisableMask:
available = hal.signals_cap.bits & ~(control_signals_t){ .probe_triggered = On }.bits;
break;
case Setting_SpindleInvertMask:
available = spindle_get_caps(false).gpio_controlled;
break;
@@ -2010,10 +2015,10 @@ PROGMEM static const setting_detail_t setting_detail[] = {
{ Setting_JunctionDeviation, Group_General, "Junction deviation", "mm", Format_Decimal, "#####0.000", NULL, NULL, Setting_IsLegacy, &settings.junction_deviation, NULL, NULL },
{ Setting_ArcTolerance, Group_General, "Arc tolerance", "mm", Format_Decimal, "#####0.000", NULL, NULL, Setting_IsLegacy, &settings.arc_tolerance, NULL, NULL },
{ Setting_ReportInches, Group_General, "Report in inches", NULL, Format_Bool, NULL, NULL, NULL, Setting_IsLegacyFn, set_report_inches, get_int, NULL },
{ Setting_ControlInvertMask, Group_ControlSignals, "Invert control inputs", NULL, Format_Bitfield, control_signals, NULL, NULL, Setting_IsExpandedFn, set_control_invert, get_int, NULL },
{ Setting_ControlInvertMask, Group_ControlSignals, "Invert control inputs", NULL, Format_Bitfield, control_signals, NULL, NULL, Setting_IsExpandedFn, set_control_invert, get_int, is_setting_available },
{ Setting_CoolantInvertMask, Group_Coolant, "Invert coolant outputs", NULL, Format_Bitfield, coolant_signals, NULL, NULL, Setting_IsExtended, &settings.coolant.invert.mask, NULL, NULL },
{ Setting_SpindleInvertMask, Group_Spindle, "Invert spindle signals", NULL, Format_Bitfield, spindle_signals, NULL, NULL, Setting_IsExtendedFn, set_spindle_invert, get_int, is_setting_available, { .reboot_required = On } },
{ Setting_ControlPullUpDisableMask, Group_ControlSignals, "Pullup disable control inputs", NULL, Format_Bitfield, control_signals, NULL, NULL, Setting_IsExtendedFn, set_control_disable_pullup, get_int, NULL },
{ Setting_ControlPullUpDisableMask, Group_ControlSignals, "Pullup disable control inputs", NULL, Format_Bitfield, control_signals, NULL, NULL, Setting_IsExtendedFn, set_control_disable_pullup, get_int, is_setting_available },
{ Setting_LimitPullUpDisableMask, Group_Limits, "Pullup disable limit inputs", NULL, Format_AxisMask, NULL, NULL, NULL, Setting_IsExtended, &settings.limits.disable_pullup.mask, NULL, NULL },
{ Setting_ProbePullUpDisable, Group_Probing, "Pullup disable probe inputs", NULL, Format_Bitfield, probe_signals, NULL, NULL, Setting_IsLegacyFn, set_probe_disable_pullup, get_int, is_setting_available },
{ Setting_SoftLimitsEnable, Group_Limits, "Soft limits enable", NULL, Format_Bool, NULL, NULL, NULL, Setting_IsLegacyFn, set_soft_limits_enable, get_int, NULL },