From 5a052010418d5f49ffa42114713ff7de56362ff4 Mon Sep 17 00:00:00 2001 From: Terje Io Date: Thu, 2 Jan 2025 13:31:41 +0100 Subject: [PATCH] Fix for coolant issue when resetting from feed hold state. --- README.md | 4 ++-- changelog.md | 19 ++++++++++++++++++- grbl.h | 4 ++-- modbus.h | 2 ++ protocol.c | 2 +- settings.c | 18 +++++++++--------- 6 files changed, 34 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 34f9507..237e980 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## grblHAL ## -Latest build date is 20241230, see the [changelog](changelog.md) for details. +Latest build date is 20250102, 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. --- -20241230 +20250102 diff --git a/changelog.md b/changelog.md index d0cf542..004b7e6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,22 @@ ## grblHAL changelog +20250102 + +Core: + +* Fix for coolant issue when resetting from feed hold state. Ref. STMF32F4xx issue [#205](https://github.com/grblHAL/STM32F4xx/issues/205). + +Drivers: + +* STM32F4xx, STM32F7xx: some minor fixes. + +Plugins: + +* Spindle: fix for alarm 14 beeing raised on reset. Ref. STMF32F4xx issue [#205](https://github.com/grblHAL/STM32F4xx/issues/205). +Added retry handling to Modbus RTU driver, updated VFD spindle drivers accordingly. + +--- + 20250101 Drivers: @@ -8,7 +25,7 @@ Drivers: * iMXRT1062: fixed regression causing compiler failure if laser PPI plugin is enabled. -* STM32F4xx: updates for Web Builder. +* STM32F1xx, STM32F4xx: updates for Web Builder. Plugins: diff --git a/grbl.h b/grbl.h index ebb5817..28e4498 100644 --- a/grbl.h +++ b/grbl.h @@ -3,7 +3,7 @@ Part of grblHAL - Copyright (c) 2017-2024 Terje Io + Copyright (c) 2017-2025 Terje Io Copyright (c) 2015-2016 Sungeun K. Jeon for Gnea Research LLC grblHAL is free software: you can redistribute it and/or modify @@ -42,7 +42,7 @@ #else #define GRBL_VERSION "1.1f" #endif -#define GRBL_BUILD 20241230 +#define GRBL_BUILD 20250102 #define GRBL_URL "https://github.com/grblHAL" diff --git a/modbus.h b/modbus.h index eae18fb..8fbf7e1 100644 --- a/modbus.h +++ b/modbus.h @@ -65,6 +65,8 @@ typedef struct { } modbus_message_t; typedef struct { + uint8_t retries; + uint16_t retry_delay; void (*on_rx_packet)(modbus_message_t *msg); void (*on_rx_exception)(uint8_t code, void *context); } modbus_callbacks_t; diff --git a/protocol.c b/protocol.c index 3d197a3..b84ad98 100644 --- a/protocol.c +++ b/protocol.c @@ -362,7 +362,7 @@ bool protocol_main_loop (void) // completed. In either case, auto-cycle start, if enabled, any queued moves. protocol_auto_cycle_start(); - if(!protocol_execute_realtime() && sys.abort) // Runtime command check point. + if(sys.abort || !protocol_execute_realtime()) // Runtime command check point. return !sys.flags.exit; // Bail to main() program loop to reset system. sys.cancel = false; diff --git a/settings.c b/settings.c index 8de9ba9..f817f83 100644 --- a/settings.c +++ b/settings.c @@ -3,7 +3,7 @@ Part of grblHAL - Copyright (c) 2017-2024 Terje Io + Copyright (c) 2017-2025 Terje Io Copyright (c) 2011-2015 Sungeun K. Jeon Copyright (c) 2009-2011 Simen Svale Skogsrud @@ -1070,13 +1070,13 @@ static status_code_t set_linear_piece (setting_id_t id, char *svalue) float rpm, start, end; if(*svalue == '\0' || (svalue[0] == '0' && svalue[1] == '\0')) { - settings.spindle.pwm_piece[idx].rpm = NAN; - settings.spindle.pwm_piece[idx].start = - settings.spindle.pwm_piece[idx].end = 0.0f; + settings.pwm_spindle.pwm_piece[idx].rpm = NAN; + settings.pwm_spindle.pwm_piece[idx].start = + settings.pwm_spindle.pwm_piece[idx].end = 0.0f; } else if(sscanf(svalue, "%f,%f,%f", &rpm, &start, &end) == 3) { - settings.spindle.pwm_piece[idx].rpm = rpm; - settings.spindle.pwm_piece[idx].start = start; - settings.spindle.pwm_piece[idx].end = end; + settings.pwm_spindle.pwm_piece[idx].rpm = rpm; + settings.pwm_spindle.pwm_piece[idx].start = start; + settings.pwm_spindle.pwm_piece[idx].end = end; //?? if(idx == 0) // settings.spindle.rpm_min = rpm; } else @@ -1091,10 +1091,10 @@ static char *get_linear_piece (setting_id_t id) uint32_t idx = id - Setting_LinearSpindlePiece1; - if(isnan(settings.spindle.pwm_piece[idx].rpm)) + if(isnan(settings.pwm_spindle.pwm_piece[idx].rpm)) *buf = '\0'; else - snprintf(buf, sizeof(buf), "%g,%g,%g", settings.spindle.pwm_piece[idx].rpm, settings.spindle.pwm_piece[idx].start, settings.spindle.pwm_piece[idx].end); + snprintf(buf, sizeof(buf), "%g,%g,%g", settings.pwm_spindle.pwm_piece[idx].rpm, settings.pwm_spindle.pwm_piece[idx].start, settings.pwm_spindle.pwm_piece[idx].end); return buf; }