Fix for incorrect handling of mode flags when mounting root filesystem.

Added option to list hidden filesystems.
This commit is contained in:
Terje Io
2023-12-18 09:22:22 +01:00
parent 2b10e62bfc
commit 1486280b5e
4 changed files with 27 additions and 11 deletions

View File

@@ -1,10 +1,26 @@
## grblHAL changelog
<a name="20231218"/>Build 20231218
Core:
* VFS: fix for incorrect handling of mode flags when mounting root filesystem. Added option to list hidden filesystems.
Drivers:
* ESP32: moved mount of littlefs filesystem until after settings are loaded.
Plugins:
* WebUI: improved handling of hidden littlefs filesystem.
---
<a name="20231217"/>20231217
Drivers:
* ESP32: Reverted MKS DLC32 SD card SPI pins assignment, ref. [issue 88](https://github.com/grblHAL/ESP32/issues/88).
* ESP32: reverted MKS DLC32 SD card SPI pins assignment, ref. [issue 88](https://github.com/grblHAL/ESP32/issues/88).
Fixed I2S stepping issues, added dir > step delay with 4 microseconds minimum delay. Ref. [issue 87](https://github.com/grblHAL/ESP32/issues/87).
Plugins:

2
grbl.h
View File

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

16
vfs.c
View File

@@ -462,10 +462,10 @@ bool vfs_mount (const char *path, const vfs_t *fs, vfs_st_mode_t mode)
{
vfs_mount_t *vfs;
if(!strcmp(path, "/"))
if(!strcmp(path, "/")) {
root.vfs = fs;
else if((vfs = (vfs_mount_t *)malloc(sizeof(vfs_mount_t)))) {
root.mode = mode;
} else if((vfs = (vfs_mount_t *)malloc(sizeof(vfs_mount_t)))) {
strcpy(vfs->path, path);
if(vfs->path[strlen(path) - 1] != '/')
@@ -493,10 +493,10 @@ bool vfs_unmount (const char *path)
{
// TODO: close open files?
if(!strcmp(path, "/"))
if(!strcmp(path, "/")) {
root.vfs = &fs_null;
else {
root.mode = (vfs_st_mode_t){ .directory = true, .read_only = true, .hidden = true };
} else {
vfs_mount_t *mount = get_mount(path);
if(mount) {
@@ -557,7 +557,7 @@ vfs_drives_t *vfs_drives_open (void)
return handle;
}
vfs_drive_t *vfs_drives_read (vfs_drives_t *handle)
vfs_drive_t *vfs_drives_read (vfs_drives_t *handle, bool add_hidden)
{
static vfs_drive_t drive;
@@ -574,7 +574,7 @@ vfs_drive_t *vfs_drives_read (vfs_drives_t *handle)
handle->mount = handle->mount->next;
if(handle->mount) do {
if(!handle->mount->mode.hidden && handle->mount->vfs->fs_name)
if((!handle->mount->mode.hidden || add_hidden) && handle->mount->vfs->fs_name)
break;
} while((handle->mount = handle->mount->next));
}

2
vfs.h
View File

@@ -212,7 +212,7 @@ int vfs_utime (const char *filename, struct tm *modified);
vfs_free_t *vfs_fgetfree (const char *path);
vfs_drives_t *vfs_drives_open (void);
vfs_drive_t *vfs_drives_read (vfs_drives_t *handle);
vfs_drive_t *vfs_drives_read (vfs_drives_t *handle, bool add_hidden);
void vfs_drives_close (vfs_drives_t *handle);
vfs_free_t *vfs_drive_getfree (vfs_drive_t *drive);
int vfs_drive_format (vfs_drive_t *drive);