Fix LVGL filesystem interface

This commit is contained in:
fvanroie 2022-09-11 16:11:19 +02:00
parent dca38d199c
commit cf6817304b
3 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@
/********************* /*********************
* INCLUDES * INCLUDES
*********************/ *********************/
#include "lvgl.h"
#include "lv_fs_if.h" #include "lv_fs_if.h"
#if LV_USE_FS_IF #if LV_USE_FS_IF

View File

@ -13,6 +13,7 @@ extern "C" {
/********************* /*********************
* INCLUDES * INCLUDES
*********************/ *********************/
#include "lvgl.h"
#if LV_USE_FS_IF #if LV_USE_FS_IF

View File

@ -6,6 +6,7 @@
/********************* /*********************
* INCLUDES * INCLUDES
*********************/ *********************/
#include "lvgl.h"
#include "lv_fs_if.h" #include "lv_fs_if.h"
#if LV_USE_FS_IF #if LV_USE_FS_IF
#if LV_FS_IF_PC != '\0' #if LV_FS_IF_PC != '\0'
@ -150,6 +151,9 @@ static lv_fs_res_t fs_open(lv_fs_drv_t* drv, void* file_p, const char* path, lv_
sprintf(buf, LV_FS_PC_PATH "\\%s", path); sprintf(buf, LV_FS_PC_PATH "\\%s", path);
#endif #endif
LV_LOG_USER(LV_FS_PC_PATH "/%%s");
LV_LOG_USER(buf);
file_t f = fopen(buf, flags); file_t f = fopen(buf, flags);
if(f == NULL) return LV_FS_RES_UNKNOWN; if(f == NULL) return LV_FS_RES_UNKNOWN;
@ -298,7 +302,7 @@ static lv_fs_res_t fs_trunc(lv_fs_drv_t* drv, void* file_p)
fflush(*fp); /*If not syncronized fclose can write the truncated part*/ fflush(*fp); /*If not syncronized fclose can write the truncated part*/
uint32_t p = ftell(*fp); uint32_t p = ftell(*fp);
// ftruncate(fileno(*fp), p); // ftruncate(fileno(*fp), p);
return LV_FS_RES_OK; return LV_FS_RES_OK;
} }