|
|
@ -305,7 +305,25 @@ WEAK long Rd_Mtell(void *file) |
|
|
|
|
|
|
|
|
WEAK int Rd_fflush(void *file) |
|
|
WEAK int Rd_fflush(void *file) |
|
|
{ |
|
|
{ |
|
|
|
|
|
#ifdef USE_W25QXX |
|
|
|
|
|
#if LV_USE_FS_LITTLEFS |
|
|
|
|
|
(void)file; |
|
|
return RD_SUCCESS; |
|
|
return RD_SUCCESS; |
|
|
|
|
|
#else |
|
|
|
|
|
if (file == NULL) return RD_FAILURE; |
|
|
|
|
|
lfs_file_t *fp = (lfs_file_t *)file; |
|
|
|
|
|
int err = lfs_file_sync(&g_lfs, fp); |
|
|
|
|
|
if (err < 0) |
|
|
|
|
|
{ |
|
|
|
|
|
printf("lfs_file_sync failed: %d\n", err); |
|
|
|
|
|
return RD_FAILURE; |
|
|
|
|
|
} |
|
|
|
|
|
return RD_SUCCESS; |
|
|
|
|
|
#endif |
|
|
|
|
|
#else |
|
|
|
|
|
(void)file; |
|
|
|
|
|
return RD_FAILURE; |
|
|
|
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
WEAK int Rd_remove(const char *filename) |
|
|
WEAK int Rd_remove(const char *filename) |
|
|
@ -335,6 +353,12 @@ WEAK int Rd_rename(const char *oldpath, const char *newpath) |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int Rd_Lfs_Mount(void) |
|
|
|
|
|
{ |
|
|
|
|
|
lfs_format(&g_lfs, &g_cfg); |
|
|
|
|
|
return lfs_mount(&g_lfs, &g_cfg); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
WEAK void Rd_LittleFSInit(void) |
|
|
WEAK void Rd_LittleFSInit(void) |
|
|
{ |
|
|
{ |
|
|
#ifdef USE_W25QXX |
|
|
#ifdef USE_W25QXX |
|
|
@ -345,8 +369,7 @@ WEAK void Rd_LittleFSInit(void) |
|
|
if (err) |
|
|
if (err) |
|
|
{ |
|
|
{ |
|
|
printf("mount error format...\n"); |
|
|
printf("mount error format...\n"); |
|
|
lfs_format(&g_lfs, &g_cfg); |
|
|
(void)Rd_Lfs_Mount(); |
|
|
lfs_mount(&g_lfs, &g_cfg); |
|
|
|
|
|
} |
|
|
} |
|
|
return; |
|
|
return; |
|
|
#else |
|
|
#else |
|
|
|