Added platform specific formatting strings for int32_t, "hardened" task handler code.

This commit is contained in:
Terje Io
2026-03-13 10:39:39 +01:00
parent 38cc54d74e
commit 29ea451996
5 changed files with 29 additions and 12 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
## grblHAL ##
Latest build date is 20260311, see the [changelog](changelog.md) for details.
Latest build date is 20260312, 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.
+9 -1
View File
@@ -1,5 +1,13 @@
## grblHAL changelog
<a name="20260312">Build 20260312
Core:
* Added platform specific formatting strings for int32_t, "hardened" task handler code.
---
<a name="20260311">Build 20260311
Core:
@@ -15,7 +23,7 @@ Plugins:
* SD card: added `$PWD` command for outputting current working directory and `$CWD=<directory>` as an alternative to `$F=<directory>` to set current working directory.
`<directory>` can be `..` for up one level, `/` for the root directory, a single directory name or a path to a directory - either relative to CWD or absolute.
* Spindle: delayed on actions on soft reset till after reset is cleared.
* Spindle: delayed actions on soft reset till after reset is cleared.
* Networking, ftp: improved handling of current working directory. Note that this is not the same as maintained by the core.
+1 -1
View File
@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20260311
#define GRBL_BUILD 20260312
#define GRBL_URL "https://github.com/grblHAL"
+13 -8
View File
@@ -122,12 +122,17 @@ __attribute__((always_inline)) static inline void task_free (core_task_t *task)
__attribute__((always_inline)) static inline core_task_t *task_run (core_task_t *task)
{
hal.irq_disable();
core_task_t *t = task;
foreground_task_ptr fn = task->fn;
void *data = task->data;
task = task->next;
task_free(t);
hal.irq_enable();
fn(data);
return task;
@@ -536,7 +541,7 @@ FLASHMEM int grbl_enter (void)
protocol_enqueue_realtime_command(sys.mpg_mode ? CMD_STATUS_REPORT_ALL : CMD_STATUS_REPORT);
if(tasks.on_reset)
system_set_exec_state_flag(EXEC_RT_COMMAND); // execute any on reset tasks
system_set_exec_state_flag(EXEC_RT_COMMAND); // execute any reset tasks
// Start main loop. Processes program inputs and executes them.
if(!(looping = protocol_main_loop()))
@@ -578,11 +583,6 @@ static void task_execute (sys_state_t state)
core_task_t *task;
if(lock)
return;
lock = true;
if(tasks.immediate && sys.driver_started) {
hal.irq_disable();
@@ -594,6 +594,11 @@ static void task_execute (sys_state_t state)
} while((task = task_run(task)));
}
if(lock)
return;
lock = true;
uint32_t now = hal.get_elapsed_ticks();
if(!(now == last_ms || tasks.delayed == tasks.systick)) {
@@ -619,12 +624,12 @@ static void task_execute (sys_state_t state)
}
}
hal.irq_enable();
void *data = task->data;
foreground_task_ptr fn = task->fn;
task_free(task);
hal.irq_enable();
fn(data);
}
}
+5 -1
View File
@@ -3,7 +3,7 @@
Part of grblHAL
Copyright (c) 2021-2025 Terje Io
Copyright (c) 2021-2026 Terje Io
grblHAL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,9 +47,13 @@
#endif
#if defined(STM32_PLATFORM) || defined(__LPC17XX__) || defined(__IMXRT1062__) || defined(__SAM3X8E__)
#define INT32FMT "%li"
#define INT32SFMT "li"
#define UINT32FMT "%lu"
#define UINT32SFMT "lu"
#else
#define INT32FMT "%i"
#define INT32SFMT "i"
#define UINT32FMT "%u"
#define UINT32SFMT "u"
#endif