From 6704579236071ee0aa76b749283de337a0786d61 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 19 Oct 2018 15:18:24 +0700 Subject: [PATCH] lfs clean up --- libraries/FileSystem/src/InternalFS.cpp | 5 +---- libraries/FileSystem/src/littlefs/lfs_util.h | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libraries/FileSystem/src/InternalFS.cpp b/libraries/FileSystem/src/InternalFS.cpp index a183c8fe..bf33519f 100644 --- a/libraries/FileSystem/src/InternalFS.cpp +++ b/libraries/FileSystem/src/InternalFS.cpp @@ -45,11 +45,8 @@ #define LFS_FLASH_ADDR 0x6D000 #endif -#define LFS_PAGE_SIZE 4096 -#define LFS_FLASH_SIZE (7*LFS_PAGE_SIZE) - +#define LFS_FLASH_SIZE (7*FLASH_NRF52_PAGE_SIZE) #define LFS_BLOCK_SIZE 128 -#define LFS_BLOCK_PER_PAGE (LFS_PAGE_SIZE/LFS_BLOCK_SIZE) //--------------------------------------------------------------------+ // LFS Disk IO diff --git a/libraries/FileSystem/src/littlefs/lfs_util.h b/libraries/FileSystem/src/littlefs/lfs_util.h index 1a566fcb..5c141b29 100644 --- a/libraries/FileSystem/src/littlefs/lfs_util.h +++ b/libraries/FileSystem/src/littlefs/lfs_util.h @@ -45,25 +45,26 @@ extern "C" // Macros, may be replaced by system specific wrappers. Arguments to these // macros must not have side-effects as the macros can be removed for a smaller // code footprint +int cprintf (const char * format, ...); // Logging functions #ifndef LFS_NO_DEBUG #define LFS_DEBUG(fmt, ...) \ - printf("lfs debug:%d: " fmt "\n", __LINE__, __VA_ARGS__) + cprintf("lfs debug:%d: " fmt "\n", __LINE__, __VA_ARGS__) #else #define LFS_DEBUG(fmt, ...) #endif #ifndef LFS_NO_WARN #define LFS_WARN(fmt, ...) \ - printf("lfs warn:%d: " fmt "\n", __LINE__, __VA_ARGS__) + cprintf("lfs warn:%d: " fmt "\n", __LINE__, __VA_ARGS__) #else #define LFS_WARN(fmt, ...) #endif #ifndef LFS_NO_ERROR #define LFS_ERROR(fmt, ...) \ - printf("lfs error:%d: " fmt "\n", __LINE__, __VA_ARGS__) + cprintf("lfs error:%d: " fmt "\n", __LINE__, __VA_ARGS__) #else #define LFS_ERROR(fmt, ...) #endif