Added capability flags to HAL for all coolant outputs.

Hide related settings when no spindle and/or coolant outputs are available. From PR #479.
Fixed typo related to Modbus direction signal. Ref. issue #478.
Fixed typo in handling of aux output port settings. Ref issue #476.
This commit is contained in:
Terje Io
2024-03-30 21:08:48 +01:00
parent d9ed1bd89c
commit 5afac36157
11 changed files with 62 additions and 30 deletions
+32 -6
View File
@@ -1,25 +1,51 @@
## grblHAL changelog
<a name="202403230"/>Build 20240330
Core:
* Added capability flags to HAL for all coolant outputs.
* Hide related settings when no spindle and/or coolant outputs are available. From [PR #479](https://github.com/grblHAL/core/pull/479).
* Fixed typo related to Modbus direction signal. Ref. issue [#478](https://github.com/grblHAL/core/issues/478).
* Fixed typo in handling of aux output port settings. Ref issue [#476](https://github.com/grblHAL/core/issues/476).
Drivers:
* All: updated for coolant capability flags core change.
Plugins:
* Spindle: added packet length to Modbus RX callback. Ref. [issue #26](https://github.com/grblHAL/Plugins_spindle/issues/26).
* Macros: fixed typo causing compilation to fail.
* Trinamic: switched to enum for default driver mode to avoid warnings from TI compiler.
---
<a name="20240328"/>Build 20240328
Core:
* Added missing null spindle handler for ESP32, issue #473.
* Added missing null spindle handler for ESP32, issue [#473](https://github.com/grblHAL/core/issues/473).
* Fix for unable to set $484 to 0, issue #466.
* Fix for unable to set $484 to 0, issue [#466](https://github.com/grblHAL/core/issues/466).
* Added setting $673 for setting coolant on delay after feedhold. Available when safety door handling is not enabled.
Fixed obscure bug carried over from legacy Grbl related to this. Issue #467.
Fixed obscure bug carried over from legacy Grbl related to this. Issue [#467](https://github.com/grblHAL/core/issues/467).
* Enabled setting $394 for spindle on delay after feedhold. Available when safety door handling is not enabled.
Drivers:
* RP2040: Fixed regression causing step generation for BTT SKR Pico to partly fail in some configurations. "Hardened" code.
* RP2040: fixed regression causing step generation for BTT SKR Pico to partly fail in some configurations. "Hardened" code.
Plugins:
* Motors: Fixed bug that left ganged motor drivers in wrong state after leaving the ioSender _Trinamic tuner_ tab.
* Motors: fixed bug that left ganged motor drivers in wrong state after leaving the ioSender _Trinamic tuner_ tab.
---
@@ -27,7 +53,7 @@ Plugins:
Core:
* Fixes for issue #470 and #472, index overflows.
* Fixes for issue [#470](https://github.com/grblHAL/core/issues/470) and [#472](https://github.com/grblHAL/core/issues/472), index overflows.
Drivers:
+2 -2
View File
@@ -337,8 +337,8 @@
#define MODBUS_TCP_ENABLED 0b100
#if MODBUS_ENABLE == 2
#undef MOBUS_ENABLE
#define MOBUS_ENABLE 0b011
#undef MODBUS_ENABLE
#define MODBUS_ENABLE 0b011
#endif
#ifndef MODBUS_ENABLE
+2 -1
View File
@@ -1209,12 +1209,13 @@ status_code_t gc_execute_block (char *block)
switch(int_value) {
case 7:
if(!hal.driver_cap.mist_control)
if(!hal.coolant_cap.mist)
FAIL(Status_GcodeUnsupportedCommand);
gc_block.modal.coolant.mist = On;
break;
case 8:
// TODO: check driver cap?
gc_block.modal.coolant.flood = On;
break;
+1 -1
View File
@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20240328
#define GRBL_BUILD 20240330
#define GRBL_URL "https://github.com/grblHAL"
+1
View File
@@ -191,6 +191,7 @@ int grbl_enter (void)
hal.irq_disable = dummy_handler;
hal.irq_claim = dummy_irq_claim;
hal.nvs.size = GRBL_NVS_SIZE;
hal.coolant_cap.flood = On;
hal.limits.interrupt_callback = limit_interrupt_handler;
hal.control.interrupt_callback = control_interrupt_handler;
hal.stepper.interrupt_callback = stepper_driver_interrupt_handler;
+7 -7
View File
@@ -5,18 +5,18 @@
Copyright (c) 2016-2024 Terje Io
Grbl is free software: you can redistribute it and/or modify
grblHAL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grbl is distributed in the hope that it will be useful,
grblHAL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
*/
/*! \file
@@ -47,8 +47,7 @@
typedef union {
uint32_t value; //!< All bitmap flags.
struct {
uint32_t mist_control :1, //!< Mist control (M7) is supported.
software_debounce :1, //!< Software debounce of input switches signals is supported.
uint32_t software_debounce :1, //!< Software debounce of input switches signals is supported.
step_pulse_delay :1, //!< Stepper step pulse delay is supported.
limits_pull_up :1, //!< Pullup resistors for limit inputs are are supported.
control_pull_up :1, //!< Pullup resistors for control inputs are supported.
@@ -69,7 +68,7 @@ typedef union {
odometers :1,
pwm_spindle :1,
probe_latch :1,
unassigned :9;
unassigned :10;
};
} driver_cap_t;
@@ -636,6 +635,7 @@ typedef struct {
control_signals_t signals_cap; //!< Control input signals supported by the driver.
limit_signals_t limits_cap; //!< Limit input signals supported by the driver.
home_signals_t home_cap; //!< Home input signals supported by the driver.
coolant_state_t coolant_cap; //!< Coolant outputs supported by the driver.
} grbl_hal_t;
+1 -1
View File
@@ -718,7 +718,7 @@ static void ioport_settings_load (void)
} while(port);
if(digital.out.ports && (port = digital.out.ports->n_ports)) do {
if((xbar = hal.port.get_pin_info(Port_Digital, Port_Output, ioports_map_reverse(digital.in.ports, --port)))) {
if((xbar = hal.port.get_pin_info(Port_Digital, Port_Output, ioports_map_reverse(digital.out.ports, --port)))) {
if(xbar->config && !(xbar->mode.pwm || xbar->mode.servo_pwm)) {
out_config.inverted = !!(settings.ioport.invert_out.mask & (1 << xbar->id));
out_config.open_drain = !!(settings.ioport.od_enable_out.mask & (1 << xbar->id));
+2 -4
View File
@@ -742,15 +742,13 @@ bool protocol_exec_rt_system (void)
switch(rt_exec) {
case CMD_OVERRIDE_COOLANT_MIST_TOGGLE:
if (hal.driver_cap.mist_control && ((state_get() == STATE_IDLE) || (state_get() & (STATE_CYCLE | STATE_HOLD)))) {
if(hal.coolant_cap.mist && ((state_get() == STATE_IDLE) || (state_get() & (STATE_CYCLE | STATE_HOLD))))
coolant_state.mist = !coolant_state.mist;
}
break;
case CMD_OVERRIDE_COOLANT_FLOOD_TOGGLE:
if ((state_get() == STATE_IDLE) || (state_get() & (STATE_CYCLE | STATE_HOLD))) {
if(hal.coolant_cap.flood && ((state_get() == STATE_IDLE) || (state_get() & (STATE_CYCLE | STATE_HOLD))))
coolant_state.flood = !coolant_state.flood;
}
break;
default:
+1 -1
View File
@@ -834,7 +834,7 @@ void report_build_info (char *line, bool extended)
*append++ = 'N';
if(hal.driver_cap.mist_control)
if(hal.coolant_cap.mist)
*append++ = 'M';
#if COREXY
+12 -6
View File
@@ -1994,6 +1994,7 @@ static bool is_setting_available (const setting_detail_t *setting)
break;
#ifndef NO_SAFETY_DOOR_SUPPORT
case Setting_ParkingEnable:
case Setting_ParkingAxis:
case Setting_ParkingPulloutIncrement:
@@ -2002,10 +2003,16 @@ static bool is_setting_available (const setting_detail_t *setting)
case Setting_ParkingFastRate:
case Setting_RestoreOverrides:
case Setting_DoorOptions:
case Setting_DoorSpindleOnDelay:
case Setting_DoorCoolantOnDelay:
available = hal.signals_cap.safety_door_ajar;
break;
case Setting_DoorSpindleOnDelay:
available = hal.signals_cap.safety_door_ajar && spindle_get_count() && !spindle_get_caps(true).at_speed;
break;
case Setting_DoorCoolantOnDelay:
available = hal.signals_cap.safety_door_ajar && hal.coolant_cap.mask;
break;
#endif
case Setting_SpindleAtSpeedTolerance:
@@ -2013,7 +2020,7 @@ static bool is_setting_available (const setting_detail_t *setting)
break;
case Setting_SpindleOnDelay:
available = !hal.signals_cap.safety_door_ajar && !spindle_get_caps(true).at_speed;
available = !hal.signals_cap.safety_door_ajar && spindle_get_count() && !spindle_get_caps(true).at_speed;
break;
case Setting_AutoReportInterval:
@@ -2041,7 +2048,7 @@ static bool is_setting_available (const setting_detail_t *setting)
break;
case Setting_HoldCoolantOnDelay:
available = !hal.signals_cap.safety_door_ajar;
available = !hal.signals_cap.safety_door_ajar && hal.coolant_cap.mask;
break;
default:
@@ -2970,8 +2977,7 @@ void settings_init (void)
if(hal.stepper.get_ganged)
setting_remove_elements(Setting_GangedDirInvertMask, hal.stepper.get_ganged(false).mask);
if(!hal.driver_cap.mist_control)
setting_remove_element(Setting_CoolantInvertMask, 1);
setting_remove_element(Setting_CoolantInvertMask, hal.coolant_cap.mask);
#if COMPATIBILITY_LEVEL <= 1
if(hal.homing.get_state == NULL) {
+1 -1
View File
@@ -301,7 +301,7 @@ uint8_t spindle_get_count (void)
if(n_spindle == 0)
spindle_select(0);
return n_spindle;
return n_spindle == 1 && spindles[0].cfg->type == SpindleType_Null ? 0 : n_spindle;
}
static spindle_num_t spindle_get_num (spindle_id_t spindle_id)