Skip to content

Commit

Permalink
Revert to using LV_STDLIB_MICROPYTHON
Browse files Browse the repository at this point in the history
LV_STDLIB_BUILTIN, while making soft-reboots work, introduces issues with indev
(and probably others) so we give up the convenience of soft-reboots in favor of
working firmwares.

Related: lvgl/lv_binding_micropython#343
  • Loading branch information
MathyV committed Jun 18, 2024
1 parent d2fdf52 commit e10a7f5
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ Compile adding the `USER_C_MODULES` parameter to the `make` command.
make USER_C_MODULES=/path/to/lvgl_esp32_mpy/micropython.cmake <other options>
```

## Broken things

* [Soft-reboots are not working](https://github.com/lvgl/lv_binding_micropython/issues/343)

## Missing things

Things I'll probably still implement at some point:
Expand Down
1 change: 1 addition & 0 deletions binding/binding.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ file(WRITE ${LVGL_MPY} "")

add_library(usermod_lv_bindings INTERFACE)
target_sources(usermod_lv_bindings INTERFACE ${LVGL_MPY})
target_include_directories(usermod_lv_bindings INTERFACE ${LVGL_BINDINGS_DIR})

target_link_libraries(usermod_lv_bindings INTERFACE lvgl_interface)

Expand Down
33 changes: 33 additions & 0 deletions binding/include/lv_mp_mem_custom_include.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* MIT License
*
* Copyright (c) 2019-2021 LVGL
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/

#ifndef __LV_MP_MEM_CUSTOM_INCLUDE_H
#define __LV_MP_MEM_CUSTOM_INCLUDE_H

#include <py/mpconfig.h>
#include <py/misc.h>
#include <py/gc.h>

#endif //__LV_MP_MEM_CUSTOM_INCLUDE_H
13 changes: 9 additions & 4 deletions binding/lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
* - LV_STDLIB_RTTHREAD: RT-Thread implementation
* - LV_STDLIB_CUSTOM: Implement the functions externally
*/
#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_MALLOC LV_STDLIB_MICROPYTHON
#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN

Expand Down Expand Up @@ -320,10 +320,15 @@
* Others
*-----------*/

#define LV_ENABLE_GLOBAL_CUSTOM 0
/*Garbage Collector settings
*Used if LVGL is bound to higher level language and the memory is managed by that language*/
extern void mp_lv_init_gc();
#define LV_GC_INIT() mp_lv_init_gc()

#define LV_ENABLE_GLOBAL_CUSTOM 1
#if LV_ENABLE_GLOBAL_CUSTOM
/*Header to include for the custom 'lv_global' function"*/
#define LV_GLOBAL_CUSTOM_INCLUDE <stdint.h>
extern void *mp_lv_roots;
#define LV_GLOBAL_CUSTOM() ((lv_global_t*)mp_lv_roots)
#endif

/*Default cache size in bytes.
Expand Down

0 comments on commit e10a7f5

Please sign in to comment.