Improved support for using expander inputs for basic functions. "Hardened" code a bit.

This commit is contained in:
Terje Io
2026-03-26 20:52:26 +01:00
parent 5025b28f1f
commit eef9949d55
8 changed files with 29 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
## grblHAL ##
Latest build date is 20260320, see the [changelog](changelog.md) for details.
Latest build date is 20260326, 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.
+13
View File
@@ -1,5 +1,18 @@
## grblHAL changelog
<a name="20260326">Build 20260326
Core:
* Improved support for using expander inputs for basic functions. "Hardened" code a bit.
Drivers:
* STM32F4xx: added support for using expander inputs for basic functions, plus some optional pins for spindle encoder input.
Spindle encoder bug fix, ref. issue [#149](https://github.com/grblHAL/STM32F4xx/issues/149).
---
<a name="20260324">20260324
Core:
+1 -1
View File
@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20260321
#define GRBL_BUILD 20260326
#define GRBL_URL "https://github.com/grblHAL"
+1
View File
@@ -403,6 +403,7 @@ FLASHMEM bool ioport_set_function (xbar_t *pin, pin_function_t function, driver_
if(io_port) do {
if(io_port->ports_id == pin->ports_id && (ok = pin->set_function && pin->set_function(pin, function))) {
pin->function = function;
cfg->bus.mask &= ~(1 << (pin->id + io_port->ports_id->cfg[pin->mode.output].n_start));
cfg->count = cfg->free = -1;
+1 -1
View File
@@ -395,7 +395,7 @@ FLASHMEM static bool homing_cycle (axes_signals_t cycle, axes_signals_t auto_squ
if (mode != HomingMode_Pulloff) {
// Check homing switches state. Lock out cycle axes when they change.
homing_state = homing_signals_select(signals_state = hal.homing.get_state(), auto_square, squaring_mode);
homing_state = homing_signals_select((signals_state = hal.homing.get_state()), auto_square, squaring_mode);
// Auto squaring check
if((homing_state.mask & auto_square.mask) && squaring_mode == SquaringMode_Both) {
+2 -2
View File
@@ -580,8 +580,8 @@ static inline void aux_ctrl_claim_out_ports (aux_claim_explicit_out_ptr aux_clai
if(aux_ctrl_out[idx].gpio.port == (void *)EXPANDER_PORT) {
if(ioports_enumerate(Port_Digital, Port_Output, (pin_cap_t){ .external = On, .claimable = On }, aux_claim, &aux_ctrl_out[idx])) {
if((aux_ctrl_out[idx].output = ioport_claim(Port_Digital, Port_Output, &aux_ctrl_out[idx].port, NULL))) {
ioport_set_function((xbar_t *)aux_ctrl_out[idx].output, aux_ctrl_out[idx].function, NULL);
aux_claim_explicit(&aux_ctrl_out[idx]);
if(ioport_set_function((xbar_t *)aux_ctrl_out[idx].output, aux_ctrl_out[idx].function, NULL))
aux_claim_explicit(&aux_ctrl_out[idx]);
}
}
} else
+6 -2
View File
@@ -663,10 +663,12 @@ bool vfs_unmount (const char *path)
vfs_drive_t *vfs_get_drive (const char *path)
{
static vfs_drive_t drive;
static char mpath[VFS_MOUNT_PATH_LEN];
vfs_mount_t *mount = get_mount(path);
strcpy(mpath, mount->path);
drive.name = mount->vfs->fs_name;
drive.path = (const char *)mount->path;
drive.path = mpath;
drive.mode = mount->mode;
drive.removable = mount->vfs->removable;
drive.fs = mount->vfs;
@@ -701,13 +703,15 @@ vfs_drives_t *vfs_drives_open (void)
vfs_drive_t *vfs_drives_read (vfs_drives_t *handle, bool add_hidden)
{
static vfs_drive_t drive;
static char path[VFS_MOUNT_PATH_LEN];
bool ok;
if((ok = handle->mount != NULL)) {
strcpy(path, handle->mount->path);
drive.name = handle->mount->vfs->fs_name;
drive.path = (const char *)handle->mount->path;
drive.path = path;
drive.mode = handle->mount->mode;
drive.removable = handle->mount->vfs->removable;
drive.fs = handle->mount->vfs;
+4 -2
View File
@@ -33,6 +33,8 @@
#include <string.h>
#include <time.h>
#define VFS_MOUNT_PATH_LEN 33
#define vfs_load_plugin(x)
#ifndef bcopy
@@ -175,7 +177,7 @@ typedef struct {
typedef struct vfs_mount
{
char path[64];
char path[VFS_MOUNT_PATH_LEN];
const vfs_t *vfs;
vfs_st_mode_t mode;
#ifdef ESP_PLATFORM // some versions of ESP-IDF/Compiler combos are fcked up
@@ -198,7 +200,7 @@ typedef struct {
typedef struct {
const char *name;
const char *path;
char *path;
bool removable;
vfs_st_mode_t mode;
const void *fs;