Giter VIP home page Giter VIP logo

Comments (9)

kisvegabor avatar kisvegabor commented on August 16, 2024

If so, why not use the original file system API directly instead of using the lvgl proxy API?

LVGL can be used in many environments and platform (PC, embedded, many RTOS, many FS libs) and internally LVGL needs to have an abstract way to to open and read images and other assets.

There is no file/directory creation API because the FS API was intended to be used internally by LVGL where just read the assets.

Did you use LVGL's FS in the application code or was it required for the UI itself?

from lvgl.

Antecer avatar Antecer commented on August 16, 2024

maybe i want input some text or get some data, i need show it in lvgl, then confirmation, create the file and save it.

Could you tell me a little bit about where lv_fs is mainly used?
I would prefer to use the same file system interface throughout the program, rather than mixing multiple interfaces, which is prone to errors.

from lvgl.

XuNeo avatar XuNeo commented on August 16, 2024

With mode LV_FS_MODE_WR , it will write to file, or create if not exist.

See

else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) flags = O_RDWR | O_CREAT;

from lvgl.

Antecer avatar Antecer commented on August 16, 2024

With mode LV_FS_MODE_WR , it will write to file, or create if not exist.

See

else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) flags = O_RDWR | O_CREAT;

I know this problem can be solved by modifying the source code of lvgl, but I just raised my doubt. It would be better if the lvgl project could solve this problem in github.

from lvgl.

kisvegabor avatar kisvegabor commented on August 16, 2024

It's already in LVGL. You can use open a file with the LV_FS_MODE_WR | LV_FS_MODE_RD flags.

from lvgl.

Antecer avatar Antecer commented on August 16, 2024

It is a bit field variable, so I think the following solution should be better?

int flags = 0;
if(mode & LV_FS_MODE_RD) flags |= O_RDONLY;
if(mode & LV_FS_MODE_WR) flags |= O_WRONLY | O_CREAT;

from lvgl.

kisvegabor avatar kisvegabor commented on August 16, 2024

They are defines like this for me:

#define O_RDONLY	     00
#define O_WRONLY	     01
#define O_RDWR		     02

So O_RDONLY | O_WRONLY != O_RDWR

from lvgl.

Antecer avatar Antecer commented on August 16, 2024

They are defines like this for me:

#define O_RDONLY	     00
#define O_WRONLY	     01
#define O_RDWR		     02

So O_RDONLY | O_WRONLY != O_RDWR

Well, OK.
But if there are not too many flags, I think we should use bitmaps instead of the original define, which is more efficient.
Such changes are not destructive.
As variables used as flags, there should be no user passing in original values.

from lvgl.

lvgl-bot avatar lvgl-bot commented on August 16, 2024

We need some feedback on this issue.

Now we mark this as "stale" because there was no activity here for 14 days.

Remove the "stale" label or comment else this will be closed in 7 days.

from lvgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.