lvgl / lv_port_pc_visual_studio

Visual Studio projects for LVGL embedded graphics library. Recommended on Windows. Linux support with Wayland is work in progress.
MIT License
583 stars 296 forks source link

How to load .bin files with lv_img_set_src in the simulator? #62

Closed Kirbyrawr closed 9 months ago

Kirbyrawr commented 9 months ago

Hi there, i'm trying so hard to load a .bin file (converted img) with the visual studio simulator, however i was debugging it and it seems the following method:

{
    lv_fs_drv_t ** drv;

    _LV_LL_READ(fsdrv_ll_p, drv) {
        if((*drv)->letter == letter) {
            return *drv;
        }
    }

    return NULL;
}

Always return null no matter what, the letter passed is C.

In the end i'm always getting this error: Can't open file (C:spine\spine_animation_ready\Body.bin): unknown driver letter lv_fs.c:75

I reviewed lv_conf.h and everything is set properly there in terms of the file system, the letter is properly set and the working directory too.

Is anything that i'm doing wrong?

Thanks in advanced.

Kirbyrawr commented 9 months ago

Hi, i ended up being able to load the file, what i did is to force (*drv)->letter to C before it does the comparison and then it works. imagen

Line 465 of lv_fs.c

lv_fs_drv_t * lv_fs_get_drv(char letter)
{
    lv_fs_drv_t ** drv;

    _LV_LL_READ(fsdrv_ll_p, drv) {
        (*drv)->letter = 'C';
        if((*drv)->letter == letter) {
            return *drv;
        }
    }

    return NULL;
}

I guess there should be a better way so i leave the issue open.

Kirbyrawr commented 9 months ago

I found the issue, it seems the lv_conf.h wasn't being properly written, apologies.