Description
What MCU/Processor/Board and compiler are you using?
LVGL simulator, VS Code on Linux, Platformio, emulator_64bits
What LVGL version are you using?
LVGL v9
What do you want to achieve?
I want to access to a JPEG image on the filesystem (not a .c file) via the POSIX filesystem interface which I enabled, using the POSIX letter.
What have you tried so far?
Modified the platformio.ini file adding the following definitions to enable the filesystem, enable the letter (I used the number 65 for the corresponding ASCII uppercase letter A) and the path to the folder where I have the image.
-D LV_USE_FS_POSIX=1
-D LV_FS_POSIX_LETTER=65
-D LV_FS_POSIX_PATH="\"/home/filippo/Documents/Learn_LVGL/m6/images\""
WHAT I WANT is using the POSIX letter ‘A’ instead of a number. If I use the ‘A’ char instead of the number 65 it returns errors during compiling (see next section).
Code to reproduce
This is the piece of code I’m using:
void
load_jpg (void)
{
lv_obj_t * p_screen(lv_screen_active());
lv_obj_t * p_img(lv_image_create(p_screen));
// Posix letter and path have been specified in platformio.ini
//
lv_img_set_src(p_img, "A:/mountain_landscape.jpg");
} /* load_jpg() */
If I use:
-D LV_USE_FS_POSIX=1
-D LV_FS_POSIX_LETTER='A'
-D LV_FS_POSIX_PATH="\"/home/filippo/Documents/Learn_LVGL/m6/images\""
it returns the following error:
.pio/libdeps/emulator_64bits/lvgl/src/libs/fsdrv/lv_fs_posix.c:24:6: error: #error "LV_FS_POSIX_LETTER must be an upper case ASCII letter"
24 | #error "LV_FS_POSIX_LETTER must be an upper case ASCII letter"
| ^~~~~
.pio/libdeps/emulator_64bits/lvgl/src/libs/fsdrv/lv_fs_posix.c: In function ‘lv_fs_posix_init’:
<command-line>: error: ‘A’ undeclared (first use in this function)
.pio/libdeps/emulator_64bits/lvgl/src/libs/fsdrv/lv_fs_posix.c:75:24: note: in expansion of macro ‘LV_FS_POSIX_LETTER’
75 | fs_drv_p->letter = LV_FS_POSIX_LETTER;
| ^~~~~~~~~~~~~~~~~~
<command-line>: note: each undeclared identifier is reported only once for each function it appears in
.pio/libdeps/emulator_64bits/lvgl/src/libs/fsdrv/lv_fs_posix.c:75:24: note: in expansion of macro ‘LV_FS_POSIX_LETTER’
75 | fs_drv_p->letter = LV_FS_POSIX_LETTER;
I also tried:
-D LV_FS_POSIX_LETTER=A
-D LV_FS_POSIX_LETTER="A"
But they still return an error.