Fixed $help topic search failing if target contains spaces. Ref. issue #664.

Improved default serial port mapping when both MPG mode and keypad plugin are enabled to ensure the port is shared.
Delayed status report output on MPG mode change a few milliseconds to avoid awakening the ESP32 guru that sometimes reboots the controller.
This commit is contained in:
Terje Io
2025-01-24 21:01:56 +01:00
parent f4ca082f38
commit 4dc17753bb
6 changed files with 63 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
## grblHAL ##
Latest build date is 20250118, see the [changelog](changelog.md) for details.
Latest build date is 20250124, 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.
@@ -93,4 +93,4 @@ G/M-codes not supported by [legacy Grbl](https://github.com/gnea/grbl/wiki) are
Some [plugins](https://github.com/grblHAL/plugins) implements additional M-codes.
---
20250118
20250124

View File

@@ -1,5 +1,36 @@
## grblHAL changelog
<a name="20250124">Build 20250124
Core:
* Fixed `$help` topic search failing if target contains spaces. Ref. issue [#664](https://github.com/grblHAL/core/issues/664).
* Improved default serial port mapping when both MPG mode and keypad plugin are enabled to ensure the port is shared.
* Delayed status report output on MPG mode change a few milliseconds to avoid awakening the ESP32 guru that sometimes reboots the controller.
Drivers:
* iMXRT1062: harmonized code guard for enabling MCP3221 code with other drivers. Ref. discussion [#645](https://github.com/grblHAL/core/discussions/645#discussioncomment-11942596).
* MSP432P401R: fixed Trinamic I2C interface bridge, added support for one auxiliary PWM output.
* STM32F4xx: fixed typo and added PWM port to BTT SKR 2 map. Ref. issue [#190](https://github.com/grblHAL/STM32F4xx/issues/190#issuecomment-2563926583).
Some changes for the MKS Robin Nano board map. Ref. issue [#213](https://github.com/grblHAL/STM32F4xx/issues/213).
Plugins:
* Misc, RGB LED strips: fixed regression.
* Keypad: added better description for serial port pins shared with MPG. This will change the `$PIN` output to be more precise sometime in the future.
* Motors: fixed the Trinamic I2C interface. AFAIK noone besides me uses this...
* Trinamic: fixed regression in the TMC1230 driver.
---
<a name="20250122">20250122
Core:

View File

@@ -153,18 +153,6 @@
#undef KEYPAD_TEST
#undef TRINAMIC_TEST
#if KEYPAD_ENABLE == 2 && !defined(KEYPAD_STREAM)
#if USB_SERIAL_CDC
#define KEYPAD_STREAM 0
#else
#define KEYPAD_STREAM 1
#endif
#if (MODBUS_ENABLE & MODBUS_RTU_ENABLED) && defined(MODBUS_RTU_STREAM) && MODBUS_RTU_STREAM == MPG_STREAM
#undef KEYPAD_STREAM
#define KEYPAD_STREAM (MODBUS_RTU_STREAM + 1)
#endif
#endif
#if MPG_ENABLE && !defined(MPG_STREAM)
#if USB_SERIAL_CDC
#define MPG_STREAM 0
@@ -177,6 +165,20 @@
#endif
#endif
#if KEYPAD_ENABLE == 2 && !defined(KEYPAD_STREAM)
#if MPG_ENABLE
#define KEYPAD_STREAM MPG_STREAM
#elif USB_SERIAL_CDC
#define KEYPAD_STREAM 0
#else
#define KEYPAD_STREAM 1
#endif
#if (MODBUS_ENABLE & MODBUS_RTU_ENABLED) && defined(MODBUS_RTU_STREAM) && MODBUS_RTU_STREAM == MPG_STREAM
#undef KEYPAD_STREAM
#define KEYPAD_STREAM (MODBUS_RTU_STREAM + 1)
#endif
#endif
#if defined(COPROC_RESET_PIN) && defined(COPROC_BOOT0_PIN)
#define COPROC_PASSTHRU 1
#else

2
grbl.h
View File

@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20250120
#define GRBL_BUILD 20250124
#define GRBL_URL "https://github.com/grblHAL"

View File

@@ -354,16 +354,19 @@ static bool report_group_settings (const setting_group_detail_t *groups, const u
{
bool found = false;
uint_fast8_t idx;
char c, *s, group[26];
char c, *s1, *s2, group[26];
for(idx = 0; idx < n_groups; idx++) {
s = group;
s1 = s2 = group;
strncpy(group, groups[idx].name, sizeof(group) - 1);
// Uppercase group name
while((c = *s))
*s++ = CAPS(c);
// Remove spaces and uppercase group name
while((c = *s1++)) {
if(c != ' ')
*s2++ = CAPS(c);
}
*s2 = '\0';
if((found = matchhere(args, group))) {
hal.stream.write(ASCII_EOL "---- ");
@@ -379,10 +382,6 @@ static bool report_group_settings (const setting_group_detail_t *groups, const u
status_code_t report_help (char *args)
{
// Strip leading spaces
while(*args == ' ')
args++;
if(*args == '\0') {
hal.stream.write("Help topics:" ASCII_EOL);

View File

@@ -526,6 +526,11 @@ bool stream_mpg_register (const io_stream_t *stream, bool rx_only, stream_write_
return connection != NULL;
}
static void report_mpg_mode (void *data)
{
protocol_enqueue_realtime_command((char)((uint32_t)data));
}
bool stream_mpg_enable (bool on)
{
static io_stream_t org_stream = {
@@ -539,7 +544,7 @@ bool stream_mpg_enable (bool on)
// Deny entering MPG mode if busy
if(on == sys.mpg_mode || (on && (gc_state.file_run || !(state == STATE_IDLE || (state & (STATE_ALARM|STATE_ESTOP)))))) {
protocol_enqueue_realtime_command(CMD_STATUS_REPORT_ALL);
task_add_delayed(report_mpg_mode, (void *)CMD_STATUS_REPORT_ALL, 5);
return false;
}
@@ -576,7 +581,7 @@ bool stream_mpg_enable (bool on)
system_add_rt_report(Report_MPGMode);
// Force a realtime status report, all reports when MPG mode active
protocol_enqueue_realtime_command(on ? CMD_STATUS_REPORT_ALL : CMD_STATUS_REPORT);
task_add_delayed(report_mpg_mode, (void *)(on ? CMD_STATUS_REPORT_ALL : CMD_STATUS_REPORT), 5);
return true;
}