summaryrefslogtreecommitdiff
path: root/src/components/fs
diff options
context:
space:
mode:
authorTim Keller <geekboy1011@gmail.com>2021-10-25 03:02:02 +0000
committerTim Keller <geekboy1011@gmail.com>2021-12-10 01:18:57 +0000
commitc1aa5a5ea7d5ecde63a786827a866312c04507f9 (patch)
tree741b28e90900f5644cbc59fb91370c8cbcbf6133 /src/components/fs
parent8fb99471c38c2efd7af88d4888c5792bdd8deafb (diff)
Write works
Diffstat (limited to 'src/components/fs')
-rw-r--r--src/components/fs/FS.cpp4
-rw-r--r--src/components/fs/FS.h8
2 files changed, 9 insertions, 3 deletions
diff --git a/src/components/fs/FS.cpp b/src/components/fs/FS.cpp
index c8a5a2eb..297706fe 100644
--- a/src/components/fs/FS.cpp
+++ b/src/components/fs/FS.cpp
@@ -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) {
diff --git a/src/components/fs/FS.h b/src/components/fs/FS.h
index 1aa8d5f1..e4df9566 100644
--- a/src/components/fs/FS.h
+++ b/src/components/fs/FS.h
@@ -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;