Limit cache size if too much cache is given

This commit is contained in:
Peter Andersson
2015-07-13 20:59:03 +02:00
parent ce78955a30
commit 79abcb89a2
+1 -1
View File
@@ -91,7 +91,7 @@ s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work,
}
#if SPIFFS_CACHE
fs->cache = cache;
fs->cache_size = cache_size;
fs->cache_size = (cache_size > (config->log_page_size*32)) ? config->log_page_size*32 : cache_size;
spiffs_cache_init(fs);
#endif