Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gen): Use LVGL JSON in CMake based builds too - RP2040 and ESP32 #350

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion driver/stm32/STM32F7DISC/modrk043fn48h.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void HAL_LTDC_ReloadEventCallback(LTDC_HandleTypeDef *hltdc) {
lv_display_flush_ready(dma2d_disp_drv);
}

STATIC void mp_rk043fn48h_ts_read(struct _lv_indev_t *indev_drv, lv_indev_data_t *data) {
STATIC void mp_rk043fn48h_ts_read(lv_indev_t *indev_drv, lv_indev_data_t *data) {
static TS_StateTypeDef ts_state = {0};
static int32_t lastX = 0;
static int32_t lastY = 0;
Expand Down
36 changes: 35 additions & 1 deletion mkrules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,48 @@ function(lv_bindings)
set(LV_PP_FILTERED ${LV_PP})
endif()

set(LV_JSON ${CMAKE_BINARY_DIR}/lvgl_all.json)

if (EXISTS ${LVGL_DIR}/scripts/gen_json/gen_json.py)
set(LVGL_ALL_H ${CMAKE_BINARY_DIR}/lvgl_all.h)
add_custom_command(
OUTPUT
${LVGL_ALL_H}
COMMAND
echo "\"#include\"" "\"\\\"${LVGL_DIR}/lvgl.h\\\"\"" > ${LVGL_ALL_H}
COMMAND
echo "\"#include\"" "\"\\\"${LVGL_DIR}/src/lvgl_private.h\\\"\"" >> ${LVGL_ALL_H}
COMMAND_EXPAND_LISTS
)
add_custom_command(
OUTPUT
${LV_JSON}
COMMAND
${Python3_EXECUTABLE} ${LVGL_DIR}/scripts/gen_json/gen_json.py --target-header ${LVGL_ALL_H} > ${LV_JSON}
DEPENDS
${LVGL_DIR}/scripts/gen_json/gen_json.py
${LVGL_ALL_H}
COMMAND_EXPAND_LISTS
)
else()
add_custom_command(
OUTPUT
${LV_JSON}
COMMAND
echo "{}" > ${LV_JSON}
COMMAND_EXPAND_LISTS
)
endif()

add_custom_command(
OUTPUT
${LV_OUTPUT}
COMMAND
${Python3_EXECUTABLE} ${LV_BINDINGS_DIR}/gen/gen_mpy.py ${LV_GEN_OPTIONS} -MD ${LV_MPY_METADATA} -E ${LV_PP_FILTERED} ${LV_INPUT} > ${LV_OUTPUT} || (rm -f ${LV_OUTPUT} && /bin/false)
${Python3_EXECUTABLE} ${LV_BINDINGS_DIR}/gen/gen_mpy.py ${LV_GEN_OPTIONS} -MD ${LV_MPY_METADATA} -E ${LV_PP_FILTERED} -J ${LV_JSON} ${LV_INPUT} > ${LV_OUTPUT} || (rm -f ${LV_OUTPUT} && /bin/false)
DEPENDS
${LV_BINDINGS_DIR}/gen/gen_mpy.py
${LV_PP_FILTERED}
${LV_JSON}
COMMAND_EXPAND_LISTS
)

Expand Down