Write works

This commit is contained in:
Tim Keller
2021-10-25 03:02:02 +00:00
parent 8fb99471c3
commit c1aa5a5ea7
4 changed files with 77 additions and 18 deletions

View File

@@ -107,7 +107,9 @@ int FS::DirCreate(const char* path) {
int FS::Stat(const char* path, lfs_info* info) {
return lfs_stat(&lfs, path, info);
}
lfs_ssize_t FS::GetFSSize(){
return lfs_fs_size(&lfs);
}
// Delete directory and all files inside
int FS::DirDelete(const char* path) {

View File

@@ -10,6 +10,8 @@ namespace Pinetime {
public:
FS(Pinetime::Drivers::SpiNorFlash&);
void Init();
void LVGLFileSystemInit();
@@ -30,10 +32,11 @@ namespace Pinetime {
int DirRewind(lfs_dir_t* dir);
int DirCreate(const char* path);
int DirDelete(const char* path);
lfs_ssize_t GetFSSize();
int Stat(const char* path, lfs_info* info);
void VerifyResource();
static size_t getSize(){return size;}
static size_t getBlockSize(){return blockSize;}
private:
Pinetime::Drivers::SpiNorFlash& flashDriver;
@@ -62,6 +65,7 @@ namespace Pinetime {
static constexpr size_t startAddress = 0x0B4000;
static constexpr size_t size = 0x34C000;
static constexpr size_t blockSize = 4096;
bool resourcesValid = false;
const struct lfs_config lfsConfig;