added python tool inital version
This commit is contained in:
23
firmware/src/fs.c
Normal file
23
firmware/src/fs.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <zephyr/fs/littlefs.h>
|
||||
#include <fs.h>
|
||||
LOG_MODULE_REGISTER(buzz_fs, LOG_LEVEL_INF);
|
||||
|
||||
#define STORAGE_PARTITION_ID FIXED_PARTITION_ID(littlefs_storage)
|
||||
FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(fs_storage_data);
|
||||
|
||||
static struct fs_mount_t fs_storage_mnt = {
|
||||
.type = FS_LITTLEFS,
|
||||
.fs_data = &fs_storage_data,
|
||||
.storage_dev = (void *)STORAGE_PARTITION_ID,
|
||||
.mnt_point = "/lfs",
|
||||
};
|
||||
|
||||
int fs_init(void) {
|
||||
int rc = fs_mount(&fs_storage_mnt);
|
||||
if (rc < 0) {
|
||||
LOG_ERR("Error mounting filesystem: %d", rc);
|
||||
return rc;
|
||||
}
|
||||
LOG_DBG("Filesystem mounted successfully");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user