Test font_loader

This commit is contained in:
fvanroie 2020-11-25 16:49:11 +01:00
parent e984d49946
commit 5b988b5405

View File

@ -258,29 +258,29 @@ void haspSetup()
/******* File System Test ********************************************************************/ /******* File System Test ********************************************************************/
lv_fs_file_t f; lv_fs_file_t f;
lv_fs_res_t res; lv_fs_res_t res;
res = lv_fs_open(&f, "F:/test.jsonl", LV_FS_MODE_RD); res = lv_fs_open(&f, "E:/config.json", LV_FS_MODE_RD);
if(res == LV_FS_RES_OK) if(res == LV_FS_RES_OK)
Log.verbose(TAG_HASP, F("Opening test.json OK")); Log.verbose(TAG_HASP, F("Opening config.json OK"));
else else
Log.error(TAG_HASP, F("Opening test.json from FS failed %d"), res); Log.error(TAG_HASP, F("Opening config.json from FS failed %d"), res);
uint32_t btoread = 128; uint32_t btoread = 128;
uint32_t bread = 0; uint32_t bread = 0;
char buffer[128]; char buffer[129];
res = lv_fs_read(&f, &buffer, btoread, &bread); // res = lv_fs_read(&f, buffer, btoread, &bread);
if(res == LV_FS_RES_OK) { if(res == LV_FS_RES_OK) {
Log.verbose(TAG_HASP, F("Reading test.json OK %u"), bread); Log.verbose(TAG_HASP, F("Reading config.json OK %u"), bread);
buffer[127] = '\0'; buffer[127] = '\0';
Log.trace(TAG_HASP, buffer); Log.trace(TAG_HASP, buffer);
} else } else
Log.error(TAG_HASP, F("Reading test.json from FS failed %d"), res); Log.error(TAG_HASP, F("Reading config.json from FS failed %d"), res);
res = lv_fs_close(&f); res = lv_fs_close(&f);
if(res == LV_FS_RES_OK) if(res == LV_FS_RES_OK)
Log.verbose(TAG_HASP, F("Closing test.json OK")); Log.verbose(TAG_HASP, F("Closing config.json OK"));
else else
Log.error(TAG_HASP, F("Closing test.json on FS failed %d"), res); Log.error(TAG_HASP, F("Closing config.json on FS failed %d"), res);
/******* File System Test ********************************************************************/ /******* File System Test ********************************************************************/
/* ********** Font Initializations ********** */ /* ********** Font Initializations ********** */
@ -298,6 +298,10 @@ void haspSetup()
#endif #endif
#endif #endif
haspFonts[0] = lv_font_load("E:/font_1.fnt");
// haspFonts[2] = lv_font_load("E:/font_2.fnt");
// haspFonts[3] = lv_font_load("E:/font_3.fnt");
/* ********** Theme Initializations ********** */ /* ********** Theme Initializations ********** */
lv_theme_t * th; lv_theme_t * th;
switch(haspThemeId) { switch(haspThemeId) {