Conversation
PGNetHun
left a comment
There was a problem hiding this comment.
Well, I think we should define that MICROPY_PORT_DEINIT_FUNC macro in other place, not in lv_conf.h and then explicitly include that config file in mpconfigboard.h.
There must be an other way to include it automatically when LVGL is also compiled into firmware.
64e0e55 to
24fc870
Compare
|
This seems to be a better solution, I've tested stm32 port and it seems to work, esp32 will be next, Also I had to update CI make command for esp32, I guess you added |
|
@PGNetHun I've just tested the esp32 port and it seems to be working as expected, so it is ready for review/merge now 👍🏼 |
c80bd34 to
25b8d69
Compare
PGNetHun
left a comment
There was a problem hiding this comment.
Added some comments, suggestion where to define to call deinit function.
What do you think?
| make -j $(nproc) -C ports/rp2 BOARD=RPI_PICO USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake | ||
|
|
||
| # ESP32 port | ||
| # USER_C_MODULES defined in mpconfigboard.cmake |
There was a problem hiding this comment.
Please remove this line, it is incorrect.
In ESP32 port USER_C_MODULES is defined in esp32_common.cmake file:
https://github.com/lvgl/lv_micropython/blob/master/ports/esp32/esp32_common.cmake#L14
| #define LV_GC_INIT() mp_lv_init_gc() | ||
| #define LV_GC_DEINIT() mp_lv_deinit_gc() | ||
|
|
||
| // To enable deinit on soft-reset add in mpconfigboard.h |
There was a problem hiding this comment.
What if you define deinit here with a new LV_ config?
Like:
#define LV_ENABLE_DEINIT_ON_SOFT_RESET 1
#ifdef LV_ENABLE_DEINIT_ON_SOFT_RESET
extern void mp_deinit_lvgl_mod();
#define MICROPY_PORT_DEINIT_FUNC mp_deinit_lvgl_mod()
#endif
There was a problem hiding this comment.
It doesn't matter where you define it, as long as you include MICROPY_PORT_DEINIT_FUNC macro definition in mpconfigboard.h, so this way you would need to include lv_conf.h as I did before ?
There was a problem hiding this comment.
No need for this file if deinit is defined in lv_conf.h like mentioned in other comment
There was a problem hiding this comment.
Well, I think we should define that MICROPY_PORT_DEINIT_FUNC macro in other place, not in lv_conf.h and then explicitly include that config file in mpconfigboard.h.
One way or the other, so which one ?
Include `<include/lv_mp_port_soft_reset.h>` in `mpconfigboard.h` so lvgl deinit is called on soft-reset, so calling `lvgl.deinit()` is no longer necessary. This closes lvgl#343
Include
lv_conf.h<include/lv_mp_port_soft_reset.h>inmpconfigboard.hso lvgl deinit is called on soft-reset, so callinglvgl.deinit()is no longer necessary.This closes #343
EDIT: esp32 port requires Carglglz/micropython@0bd03de