From 6f4ad5bb4cca84335a34a748867bfe188cc4e140 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Mon, 15 Feb 2016 23:07:05 +0100 Subject: [PATCH] Fixed a stupid mount bug --- src/spiffs.h | 1 + src/spiffs_hydrogen.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/spiffs.h b/src/spiffs.h index c43d831..c625d93 100644 --- a/src/spiffs.h +++ b/src/spiffs.h @@ -641,6 +641,7 @@ s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh); * collection, which in turn can be used to build location tables in ram. * Used in conjuction with SPIFFS_open_by_page this may improve performance * when opening a lot of files. + * Must be invoked after mount. * * @param fs the file system struct * @param cb_func the callback on file operations diff --git a/src/spiffs_hydrogen.c b/src/spiffs_hydrogen.c index 99e5deb..a4c74cd 100644 --- a/src/spiffs_hydrogen.c +++ b/src/spiffs_hydrogen.c @@ -80,14 +80,11 @@ s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work, void *cache, u32_t cache_size, spiffs_check_callback check_cb_f) { void *user_data; - spiffs_file_callback fcb; SPIFFS_LOCK(fs); user_data = fs->user_data; - fcb = fs->file_cb_f; memset(fs, 0, sizeof(spiffs)); memcpy(&fs->cfg, config, sizeof(spiffs_config)); fs->user_data = user_data; - fs->file_cb_f = fcb; fs->block_count = SPIFFS_CFG_PHYS_SZ(fs) / SPIFFS_CFG_LOG_BLOCK_SZ(fs); fs->work = &work[0]; fs->lu_work = &work[SPIFFS_CFG_LOG_PAGE_SZ(fs)];