summaryrefslogtreecommitdiff
path: root/src/components/fs/FS.h
diff options
context:
space:
mode:
authorJF <JF002@users.noreply.github.com>2021-12-11 16:09:56 +0100
committerGitHub <noreply@github.com>2021-12-11 16:09:56 +0100
commitbccd77d5c9286223c29c037ec88d8f92ba8e91ed (patch)
tree0c4699aa138f8b651b92a0eec54c2c40ea05d9cc /src/components/fs/FS.h
parent42a5cdb5b776c2cdeb08a8c6f26606282a809178 (diff)
parent1470489e7b14fdfe4871cdc714c4a3c98917c4bb (diff)
Merge pull request #756 from geekbozu/BLE_FS
BLE FS Using adafruits Simple (not fast) BLE FS Api
Diffstat (limited to 'src/components/fs/FS.h')
-rw-r--r--src/components/fs/FS.h61
1 files changed, 36 insertions, 25 deletions
diff --git a/src/components/fs/FS.h b/src/components/fs/FS.h
index 75ba16c8..2b27ae5d 100644
--- a/src/components/fs/FS.h
+++ b/src/components/fs/FS.h
@@ -21,37 +21,49 @@ namespace Pinetime {
int FileDelete(const char* fileName);
+ int DirOpen(const char* path, lfs_dir_t* lfs_dir);
+ int DirClose(lfs_dir_t* lfs_dir);
+ int DirRead(lfs_dir_t* dir, lfs_info* info);
+ int DirRewind(lfs_dir_t* dir);
int DirCreate(const char* path);
- int DirDelete(const char* path);
-
+
+ lfs_ssize_t GetFSSize();
+ int Rename(const char* oldPath, const char* newPath);
+ int Stat(const char* path, lfs_info* info);
void VerifyResource();
- private:
+ static size_t getSize() {
+ return size;
+ }
+ static size_t getBlockSize() {
+ return blockSize;
+ }
+ private:
Pinetime::Drivers::SpiNorFlash& flashDriver;
/*
- * External Flash MAP (4 MBytes)
- *
- * 0x000000 +---------------------------------------+
- * | Bootloader Assets |
- * | 256 KBytes |
- * | |
- * 0x040000 +---------------------------------------+
- * | OTA |
- * | 464 KBytes |
- * | |
- * | |
- * | |
- * 0x0B4000 +---------------------------------------+
- * | File System |
- * | |
- * | |
- * | |
- * | |
- * 0x400000 +---------------------------------------+
- *
- */
+ * External Flash MAP (4 MBytes)
+ *
+ * 0x000000 +---------------------------------------+
+ * | Bootloader Assets |
+ * | 256 KBytes |
+ * | |
+ * 0x040000 +---------------------------------------+
+ * | OTA |
+ * | 464 KBytes |
+ * | |
+ * | |
+ * | |
+ * 0x0B4000 +---------------------------------------+
+ * | File System |
+ * | |
+ * | |
+ * | |
+ * | |
+ * 0x400000 +---------------------------------------+
+ *
+ */
static constexpr size_t startAddress = 0x0B4000;
static constexpr size_t size = 0x34C000;
static constexpr size_t blockSize = 4096;
@@ -65,7 +77,6 @@ namespace Pinetime {
static int SectorErase(const struct lfs_config* c, lfs_block_t block);
static int SectorProg(const struct lfs_config* c, lfs_block_t block, lfs_off_t off, const void* buffer, lfs_size_t size);
static int SectorRead(const struct lfs_config* c, lfs_block_t block, lfs_off_t off, void* buffer, lfs_size_t size);
-
};
}
}