|
@@ -46,9 +46,9 @@ void DataStore::begin() {
|
|
|
|
|
|
|
|
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
|
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
|
|
int _countLfsBlock(void *p, lfs_block_t block){
|
|
int _countLfsBlock(void *p, lfs_block_t block){
|
|
|
- lfs_size_t *size = (lfs_size_t*) p;
|
|
|
|
|
- *size += 1;
|
|
|
|
|
- return 0;
|
|
|
|
|
|
|
+ lfs_size_t *size = (lfs_size_t*) p;
|
|
|
|
|
+ *size += 1;
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
lfs_ssize_t _getLfsUsedBlockCount() {
|
|
lfs_ssize_t _getLfsUsedBlockCount() {
|
|
@@ -68,8 +68,8 @@ uint32_t DataStore::getStorageUsedKb() const {
|
|
|
return info.usedBytes / 1024;
|
|
return info.usedBytes / 1024;
|
|
|
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
|
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
|
|
const lfs_config* config = InternalFS._getFS()->cfg;
|
|
const lfs_config* config = InternalFS._getFS()->cfg;
|
|
|
- int usedBlockCount = _getLfsUsedBlockCount();
|
|
|
|
|
- int usedBytes = config->block_size * usedBlockCount;
|
|
|
|
|
|
|
+ int usedBlockCount = _getLfsUsedBlockCount();
|
|
|
|
|
+ int usedBytes = config->block_size * usedBlockCount;
|
|
|
return usedBytes / 1024;
|
|
return usedBytes / 1024;
|
|
|
#else
|
|
#else
|
|
|
return 0;
|
|
return 0;
|
|
@@ -86,7 +86,7 @@ uint32_t DataStore::getStorageTotalKb() const {
|
|
|
return info.totalBytes / 1024;
|
|
return info.totalBytes / 1024;
|
|
|
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
|
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
|
|
const lfs_config* config = InternalFS._getFS()->cfg;
|
|
const lfs_config* config = InternalFS._getFS()->cfg;
|
|
|
- int totalBytes = config->block_size * config->block_count;
|
|
|
|
|
|
|
+ int totalBytes = config->block_size * config->block_count;
|
|
|
return totalBytes / 1024;
|
|
return totalBytes / 1024;
|
|
|
#else
|
|
#else
|
|
|
return 0;
|
|
return 0;
|