lvgl / lv_lib_png

PNG decoder for LVGL
MIT License
66 stars 26 forks source link

Add esp32 PSRAM support and little bug fix for lv_arduino #6

Open simonchen007 opened 3 years ago

simonchen007 commented 3 years ago
1. add PSRAM support for esp32 with LV_PNG_USE_PSRAM .
2. add LV_LVGL_H_INCLUDE_SIMPLE for png_decoder_test.c
kisvegabor commented 3 years ago

Hi, I think it'd be better to add a similar pattern than in lvgl. It allows platform-independent configuration. If not defined, we can use malloc/free.

What do you think?

simonchen007 commented 3 years ago

Hi, I think it'd be better to add a similar pattern than in lvgl. It allows platform-independent configuration. If not defined, we can use malloc/free.

What do you think?

Your suggestion is good if add pattern in lvgl_conf.h but need to separate it with the LVGL malloc/free. Because we found, once we use PSRAM gobally, the LVGL would goes slower. So, we need LVGL use IRAM, but lib_png use PSRAM only.

kisvegabor commented 3 years ago

I meant adding similar defines for PNG. E.g.

#define LV_PNG_MALLOC_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
#define LV_PNG_ALLOC   malloc       /*Wrapper to malloc*/
#define LV_PNG_FREE    free           /*Wrapper to free*/
simonchen007 commented 3 years ago

That should be nice. But lv_lib_png need to be change too.

I meant adding similar defines for PNG. E.g.

#define LV_PNG_MALLOC_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
#define LV_PNG_ALLOC   malloc       /*Wrapper to malloc*/
#define LV_PNG_FREE    free           /*Wrapper to free*/
kisvegabor commented 3 years ago

But lv_lib_png need to be change too.

Yes, that's why we have this PR :smile: Or how do you mean it?

simonchen007 commented 3 years ago

But lv_lib_png need to be change too.

Yes, that's why we have this PR smile Or how do you mean it?

I'm agree with you.

kisvegabor commented 3 years ago

Can you update the PR accordingly?

simonchen007 commented 3 years ago

Can you update the PR accordingly?

To the LVGL main repo ?

kisvegabor commented 3 years ago

I mean only here by using LV_PNG_MALLOC_INCLUDE/MALLOC/FREE

yanmowudi commented 2 years ago

I meant adding similar defines for PNG. E.g.

#define LV_PNG_MALLOC_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
#define LV_PNG_ALLOC   malloc       /*Wrapper to malloc*/
#define LV_PNG_FREE    free           /*Wrapper to free*/

should we replace malloc,free,realloc with lv_mem_alloc,lv_mem_realloc,lv_mem_free?

kisvegabor commented 2 years ago

This repo was just merged into the lvgl repo. See https://github.com/lvgl/lvgl/tree/master/src/extra/libs/png Please open a new issue there to see how these configs fit into lvgl.