Skip to content
Snippets Groups Projects
Commit f5164f31 authored by q3k's avatar q3k
Browse files

st3m: reformat vfs

Whoops.
parent 796e6d94
Branches
No related tags found
No related merge requests found
......@@ -15,22 +15,34 @@ static const char *TAG = "st3m-fs";
// Entries for root filesystem. Ideally this wouldn't be static but would
// consult the ESP-IDF VFS registry.
static struct dirent _root_dirents[4] = {
{ .d_ino = 1, .d_name = ".", .d_type = DT_DIR, },
{ .d_ino = 2, .d_name = "flash", .d_type = DT_DIR, },
{ .d_ino = 3, .d_name = "sd", .d_type = DT_DIR, },
{ .d_ino = 4, .d_name = "console", .d_type = DT_DIR, },
{
.d_ino = 1,
.d_name = ".",
.d_type = DT_DIR,
},
{
.d_ino = 2,
.d_name = "flash",
.d_type = DT_DIR,
},
{
.d_ino = 3,
.d_name = "sd",
.d_type = DT_DIR,
},
{
.d_ino = 4,
.d_name = "console",
.d_type = DT_DIR,
},
};
// Handle of the wear levelling library instance
static wl_handle_t s_wl_handle = WL_INVALID_HANDLE;
static int _root_vfs_close(int fd) {
return 0;
}
static int _root_vfs_close(int fd) { return 0; }
static int _root_vfs_fcntl(int fd, int cmd, int arg) {
return 0;
}
static int _root_vfs_fcntl(int fd, int cmd, int arg) { return 0; }
static int _root_vfs_fstat(int fd, struct stat *st) {
st->st_mode = S_IFDIR;
......@@ -76,7 +88,7 @@ static DIR *_root_vfs_opendir(const char *name) {
}
static struct dirent *_root_vfs_readdir(DIR *pdir) {
st3m_rootfs_dir_t *dir = pdir;
st3m_rootfs_dir_t *dir = (st3m_rootfs_dir_t *)pdir;
if (dir->ix >= (sizeof(_root_dirents) / sizeof(struct dirent))) {
return NULL;
}
......
#include "fs.h"
#include "st3m_fs.h"
#include "st3m_mode.h"
#include "st3m_sys_data.h"
#include "st3m_tar.h"
#include "st3m_fs.h"
#include "esp_system.h"
#include "esp_vfs.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment