Develop/nn#3
Conversation
There was a problem hiding this comment.
Pull request overview
This PR backports / refactors the LVGL integration towards the 8.x API style, simplifies the build integration, and extends the HAL and memory utilities.
Changes:
- Reworks LVGL core headers and sources (events, display, input, groups, styles, drawing) to a different API surface and build layout.
- Adjusts build and packaging infrastructure (CMake, Zephyr, ESP, Micropython, GitHub Actions) to the new LVGL structure.
- Extends and refactors local utilities and HAL (TLSF-backed
ek_memwrappers, new I2C HAL, minor SPI updates) and adds LVGL documentation in multiple languages.
Reviewed changes
Copilot reviewed 61 out of 961 changed files in this pull request and generated 23 comments.
Show a summary per file
| File | Description |
|---|---|
| L3_Middlewares/LVGL/src/core/lv_obj_style.h | Refactors style-related types/APIs, adds internal structs and helpers. |
| L3_Middlewares/LVGL/src/core/lv_obj_scroll.h | Updates scroll enums, types, and prototypes to new object forward-decl pattern. |
| L3_Middlewares/LVGL/src/core/lv_obj_pos.h | Changes layout/position APIs and introduces layout registration helpers. |
| L3_Middlewares/LVGL/src/core/lv_obj_draw.h | Consolidates draw includes, defines draw-part descriptor, and exposes ext-draw helpers. |
| L3_Middlewares/LVGL/src/core/lv_indev_scroll.h | Switches scroll helpers to new indev proc type and include path. |
| L3_Middlewares/LVGL/src/core/lv_indev.h | Introduces a new public input-device API surface. |
| L3_Middlewares/LVGL/src/core/lv_event.h / lv_event.c | Reimplements the event system around lv_event_t and lv_event_send. |
| L3_Middlewares/LVGL/src/core/lv_disp.h / lv_disp.c | Adds display API (screen management, background, inactivity, invalidation). |
| L3_Middlewares/LVGL/src/core/lv_group.h / lv_group.c | Reworks focus group implementation and API names. |
| L3_Middlewares/LVGL/src/core/lv_core.mk | Adds a core source list for LVGL builds. |
| L3_Middlewares/LVGL/lvgl.h | Reorganizes top-level LVGL includes and version macros. |
| L3_Middlewares/LVGL/env_support/cmake/*.cmake | Simplifies version handling and platform integration (Zephyr, Micropython, ESP, custom). |
| L3_Middlewares/LVGL/doc/README*.md | Adds/updates multi-language LVGL README documentation. |
| L2_Core/utils/src/ek_mem.c / inc/ek_mem.h | Wraps TLSF allocators with overridable APIs and adjusts heap macros. |
| L2_Core/hal/src/ek_hal_spi.c | Minor cleanup and comments in SPI HAL stub. |
| L2_Core/hal/src/ek_hal_i2c.c / inc/ek_hal_i2c.h | Introduces a new I2C HAL abstraction with locking and list registration. |
| .github/workflows/build.yml | Simplifies CI matrix by removing LVGL ThorVG combinations. |
| L3_Middlewares/CMakeLists.txt | Removes ThorVG option and links LVGL more simply. |
| L3_Middlewares/LVGL/CMakeLists.txt | Simplifies LVGL top-level CMake config and removes version.cmake usage. |
Comments suppressed due to low confidence (2)
L3_Middlewares/LVGL/src/core/lv_indev_scroll.h:1
- Both
_lv_indev_scroll_handlerand_lv_indev_scroll_throw_handleruse the_lv_indev_proc_ttype, but this header neither declares that struct nor includes a header that does, which will lead to an unknown type error when compiling any user of these functions. Either forward-declare the type (e.g.struct _lv_indev_proc_t;) above these prototypes or include the appropriate private indev header where_lv_indev_proc_tis defined.
/**
L3_Middlewares/LVGL/src/core/lv_obj_style.h:1
- This header now omits the
lv_style.handlv_types.hincludes while still usinglv_style_t,lv_style_selector_t,lv_style_prop_t,lv_style_value_t,lv_anim_path_cb_t, etc., which will cause undeclared-type errors unless every includer happens to pull in those headers beforehand. Restore the#include "../misc/lv_style.h"(andlv_types.hif needed) or add equivalent forward declarations/typedefs so that all style-related types are visible fromlv_obj_style.halone.
/**
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /********************* | ||
| * INCLUDES | ||
| *********************/ | ||
| #include <stdbool.h> |
There was a problem hiding this comment.
The event header uses several LVGL core types (lv_res_t, lv_obj_class_t, lv_indev_t, lv_obj_draw_part_dsc_t, lv_draw_ctx_t, lv_area_t, lv_point_t, lv_anim_t, lv_coord_t, lv_cover_res_t) without including the headers that define them or forward-declaring the struct/typedefs, which will cause compilation errors when including lv_event.h in isolation. Add the appropriate includes (e.g. lv_obj.h, lv_obj_class.h, lv_indev.h, lv_obj_draw.h, lv_anim.h, lv_area.h, lv_types.h) or add the required forward declarations and typedefs so that all referenced types are visible to translation units that include this header.
| #include <stdbool.h> | |
| #include <stdbool.h> | |
| #include "../misc/lv_types.h" | |
| #include "../misc/lv_area.h" | |
| #include "../misc/lv_anim.h" | |
| #include "../indev/lv_indev.h" | |
| #include "lv_obj_draw.h" |
| struct _lv_obj_t; | ||
| struct _lv_event_dsc_t; |
There was a problem hiding this comment.
The event header uses several LVGL core types (lv_res_t, lv_obj_class_t, lv_indev_t, lv_obj_draw_part_dsc_t, lv_draw_ctx_t, lv_area_t, lv_point_t, lv_anim_t, lv_coord_t, lv_cover_res_t) without including the headers that define them or forward-declaring the struct/typedefs, which will cause compilation errors when including lv_event.h in isolation. Add the appropriate includes (e.g. lv_obj.h, lv_obj_class.h, lv_indev.h, lv_obj_draw.h, lv_anim.h, lv_area.h, lv_types.h) or add the required forward declarations and typedefs so that all referenced types are visible to translation units that include this header.
| typedef struct _lv_event_t { | ||
| struct _lv_obj_t * target; | ||
| struct _lv_obj_t * current_target; | ||
| lv_event_code_t code; |
There was a problem hiding this comment.
The event header uses several LVGL core types (lv_res_t, lv_obj_class_t, lv_indev_t, lv_obj_draw_part_dsc_t, lv_draw_ctx_t, lv_area_t, lv_point_t, lv_anim_t, lv_coord_t, lv_cover_res_t) without including the headers that define them or forward-declaring the struct/typedefs, which will cause compilation errors when including lv_event.h in isolation. Add the appropriate includes (e.g. lv_obj.h, lv_obj_class.h, lv_indev.h, lv_obj_draw.h, lv_anim.h, lv_area.h, lv_types.h) or add the required forward declarations and typedefs so that all referenced types are visible to translation units that include this header.
| typedef struct { | ||
| const lv_point_t * point; /**< A point relative to screen to check if it can click the object or not*/ | ||
| bool res; /**< true: `point` can click the object; false: it cannot*/ | ||
| } lv_hit_test_info_t; |
There was a problem hiding this comment.
The event header uses several LVGL core types (lv_res_t, lv_obj_class_t, lv_indev_t, lv_obj_draw_part_dsc_t, lv_draw_ctx_t, lv_area_t, lv_point_t, lv_anim_t, lv_coord_t, lv_cover_res_t) without including the headers that define them or forward-declaring the struct/typedefs, which will cause compilation errors when including lv_event.h in isolation. Add the appropriate includes (e.g. lv_obj.h, lv_obj_class.h, lv_indev.h, lv_obj_draw.h, lv_anim.h, lv_area.h, lv_types.h) or add the required forward declarations and typedefs so that all referenced types are visible to translation units that include this header.
| typedef struct { | ||
| lv_cover_res_t res; | ||
| const lv_area_t * area; | ||
| } lv_cover_check_info_t; |
There was a problem hiding this comment.
The event header uses several LVGL core types (lv_res_t, lv_obj_class_t, lv_indev_t, lv_obj_draw_part_dsc_t, lv_draw_ctx_t, lv_area_t, lv_point_t, lv_anim_t, lv_coord_t, lv_cover_res_t) without including the headers that define them or forward-declaring the struct/typedefs, which will cause compilation errors when including lv_event.h in isolation. Add the appropriate includes (e.g. lv_obj.h, lv_obj_class.h, lv_indev.h, lv_obj_draw.h, lv_anim.h, lv_area.h, lv_types.h) or add the required forward declarations and typedefs so that all referenced types are visible to translation units that include this header.
| * @param indev pointer to an input device | ||
| * @return pointer to the indev read refresher timer. (NULL on error) | ||
| */ | ||
| lv_timer_t * lv_indev_get_read_timer(lv_disp_t * indev); |
There was a problem hiding this comment.
The lv_indev_get_read_timer API takes an lv_disp_t * parameter while the documentation and semantics clearly refer to an input device; the type should be lv_indev_t * (or const lv_indev_t *) to match how this function is used elsewhere in LVGL. Update the function signature (and its implementation) to accept an input device pointer instead of a display pointer to prevent type mismatches and incorrect calls.
| lv_timer_t * lv_indev_get_read_timer(lv_disp_t * indev); | |
| lv_timer_t * lv_indev_get_read_timer(lv_indev_t * indev); |
| * Add a style to an object. | ||
| * @param obj pointer to an object | ||
| * @param style pointer to a style to remove. Can be NULL to check only the selector | ||
| * @param selector OR-ed values of states and a part to remove only styles with matching selectors. LV_STATE_ANY and LV_PART_ANY can be used | ||
| * | ||
| * Examples: | ||
| * @code | ||
| * lv_obj_remove_style(obj, &style, LV_PART_ANY | LV_STATE_ANY); //Remove a specific style | ||
| * | ||
| * lv_obj_remove_style(obj, NULL, LV_PART_MAIN | LV_STATE_ANY); //Remove all styles from the main part | ||
| * | ||
| * lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY); //Remove all styles | ||
| * @endcode | ||
| * @example lv_obj_remove_style(obj, &style, LV_PART_ANY | LV_STATE_ANY); //Remove a specific style | ||
| * @example lv_obj_remove_style(obj, NULL, LV_PART_MAIN | LV_STATE_ANY); //Remove all styles from the main part | ||
| * @example lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY); //Remove all styles | ||
| */ |
There was a problem hiding this comment.
The documentation for lv_obj_remove_style still says “Add a style to an object.” while the function removes styles, and the lv_obj_get_style_opa_recursive comment contains a typo (“teh MAIN part”). Update the comment header to describe removal (e.g. “Remove a style from an object.”) and fix the typo “teh” to “the” to keep the API documentation accurate and readable.
| * Get the `opa` style property from all parents and multiply and `>> 8` them. | ||
| * @param obj the object whose opacity should be get | ||
| * @param part the part whose opacity should be get. Non-MAIN parts will consider the `opa` of the MAIN part too | ||
| * @param part the part whose opacity should be get. Non-MAIN parts will consider the `opa` of teh MAIN part too |
There was a problem hiding this comment.
The documentation for lv_obj_remove_style still says “Add a style to an object.” while the function removes styles, and the lv_obj_get_style_opa_recursive comment contains a typo (“teh MAIN part”). Update the comment header to describe removal (e.g. “Remove a style from an object.”) and fix the typo “teh” to “the” to keep the API documentation accurate and readable.
| * @param part the part whose opacity should be get. Non-MAIN parts will consider the `opa` of teh MAIN part too | |
| * @param part the part whose opacity should be get. Non-MAIN parts will consider the `opa` of the MAIN part too |
|
|
||
| /** | ||
| * Get the actually set x coordinate of object, i.e. the offset from the set alignment | ||
| * Get the actually set x coordinate of object, i.e. the offset form the set alignment |
There was a problem hiding this comment.
The word “form” in “the offset form the set alignment” is a typo and should be “from” in both comments to correctly describe the offset from the set alignment.
|
|
||
| /** | ||
| * Get the actually set y coordinate of object, i.e. the offset from the set alignment | ||
| * Get the actually set y coordinate of object, i.e. the offset form the set alignment |
There was a problem hiding this comment.
The word “form” in “the offset form the set alignment” is a typo and should be “from” in both comments to correctly describe the offset from the set alignment.
No description provided.