From 4a7090d70aadddcd426d5326bb252fe4dc3ee40c Mon Sep 17 00:00:00 2001 From: Terje Io Date: Sat, 27 Jan 2024 20:17:42 +0100 Subject: [PATCH] Fixed regression mainly affecting WebUI enabled builds. Some internal changes. --- changelog.md | 18 +++++++++++++++++- crossbar.h | 8 +++++++- driver_opts.h | 4 ++++ grbl.h | 2 +- kinematics/delta.c | 2 +- vfs.c | 15 +++++++++------ vfs.h | 5 +++-- 7 files changed, 42 insertions(+), 12 deletions(-) diff --git a/changelog.md b/changelog.md index c3f13ef..93f3a02 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,22 @@ ## grblHAL changelog - Build 20240125 +Build 20240127 + +Core: + +* Fixed regression mainly affecting WebUI enabled builds. Some internal changes. + +Drivers: + +* ESP32: reorganized main driver code for readability, minor fixes. + +Plugins: + +* SD card: commented out unused code to avoid compiler warning. + +--- + +Build 20240125 Core, for developers: diff --git a/crossbar.h b/crossbar.h index 2f9f7af..8cdd2c9 100644 --- a/crossbar.h +++ b/crossbar.h @@ -501,12 +501,18 @@ typedef struct { bool servo_mode; } pwm_config_t; +typedef union + { +// pin_mode_t *pin_mode; + pwm_config_t *pwm_config; + } xbar_cfg_ptr_t __attribute__ ((__transparent_union__)); + struct xbar; typedef float (*xbar_get_value_ptr)(struct xbar *pin); typedef void (*xbar_set_value_ptr)(struct xbar *pin, float value); typedef void (*xbar_event_ptr)(bool on); -typedef bool (*xbar_config_ptr)(struct xbar *pin, void *cfg_data); +typedef bool (*xbar_config_ptr)(struct xbar *pin, xbar_cfg_ptr_t cfg_data); typedef enum { AuxCtrl_SafetyDoor = 0, diff --git a/driver_opts.h b/driver_opts.h index 95df02a..296906b 100644 --- a/driver_opts.h +++ b/driver_opts.h @@ -79,6 +79,10 @@ #define PROBE_ENABLE 1 #endif +#ifndef NEOPIXELS_ENABLE +#define NEOPIXELS_ENABLE 0 +#endif + #ifndef USB_SERIAL_CDC #define USB_SERIAL_CDC 0 // for UART comms #endif diff --git a/grbl.h b/grbl.h index 33d07fe..2b97bac 100644 --- a/grbl.h +++ b/grbl.h @@ -42,7 +42,7 @@ #else #define GRBL_VERSION "1.1f" #endif -#define GRBL_BUILD 20240125 +#define GRBL_BUILD 20240127 #define GRBL_URL "https://github.com/grblHAL" diff --git a/kinematics/delta.c b/kinematics/delta.c index 4aaf833..10cb7ed 100644 --- a/kinematics/delta.c +++ b/kinematics/delta.c @@ -542,7 +542,7 @@ static void delta_homing_complete (bool success) : machine.home_z - settings.homing.pulloff; if(machine.cfg.flags.home_to_cuboid_top) - protocol_enqueue_foreground_task(delta_go_home); + protocol_enqueue_foreground_task(delta_go_home, NULL); } if(on_homing_completed) diff --git a/vfs.c b/vfs.c index 1a7735d..3436f43 100644 --- a/vfs.c +++ b/vfs.c @@ -200,8 +200,10 @@ vfs_file_t *vfs_open (const char *filename, const char *mode) vfs_file_t *file = NULL; vfs_mount_t *mount = get_mount(filename); - if(mount && (file = mount->vfs->fopen(get_filename(mount, filename), mode))) + if(mount && (file = mount->vfs->fopen(get_filename(mount, filename), mode))) { file->fs = mount->vfs; + file->update = !mount->mode.hidden && !!strchr(mode, 'w'); + } return file; } @@ -212,7 +214,8 @@ void vfs_close (vfs_file_t *file) ((vfs_t *)(file->fs))->fclose(file); -// TODO: somehow raise vfs.on_fs_changed event when a file openened for writing is closed + if(file->update && vfs.on_fs_changed) + vfs.on_fs_changed((vfs_t *)file->fs); } size_t vfs_read (void *buffer, size_t size, size_t count, vfs_file_t *file) @@ -502,12 +505,12 @@ bool vfs_mount (const char *path, const vfs_t *fs, vfs_st_mode_t mode) mount->mode = mode; mount->next = NULL; - vfs_mount_t *mount = &root; + vfs_mount_t *lmount = &root; - while(mount->next) - mount = mount->next; + while(lmount->next) + lmount = lmount->next; - mount->next = mount; + lmount->next = mount; } if(fs && vfs.on_mount) diff --git a/vfs.h b/vfs.h index 745d0e7..041d246 100644 --- a/vfs.h +++ b/vfs.h @@ -80,7 +80,8 @@ typedef struct { typedef struct { const void *fs; size_t size; - uint8_t handle; // first byte of file handle structure + bool update; + uint8_t handle __attribute__ ((aligned (4))); // first byte of file handle structure } vfs_file_t; struct vfs_dir; @@ -191,7 +192,7 @@ typedef struct { struct vfs_dir { const void *fs; vfs_mount_ll_entry_t *mounts; - uint8_t handle; // must be last! + uint8_t handle __attribute__ ((aligned (4))); // must be last! }; extern int vfs_errno;