From 593c1c833ef367a5eac5977db7a036cf4ce80b65 Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Fri, 25 Nov 2022 12:08:17 +0100 Subject: [PATCH] update eez-framework --- .gitmodules | 2 +- CMakeLists.txt | 13 +++++-------- eez | 1 - eez-framework | 1 + lvgl-template-web.eez-project | 26 +++++++++++++++++++++----- src/conf/eez/conf.h | 11 ----------- src/ui/actions.h | 2 +- src/ui/fonts.h | 2 +- src/ui/images.h | 2 +- src/ui/screens.c | 4 ++++ src/ui/screens.h | 2 +- src/ui/styles.c | 5 +++++ src/ui/styles.h | 16 ++++++++++++++++ 13 files changed, 57 insertions(+), 30 deletions(-) delete mode 160000 eez create mode 160000 eez-framework delete mode 100644 src/conf/eez/conf.h create mode 100644 src/ui/styles.c create mode 100644 src/ui/styles.h diff --git a/.gitmodules b/.gitmodules index 35c94b4..bcf2bb9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "eez"] - path = eez + path = eez-framework url = https://github.com/eez-open/eez-framework [submodule "lvgl"] path = lvgl diff --git a/CMakeLists.txt b/CMakeLists.txt index 03978f1..2c25d06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,20 +25,17 @@ list(APPEND SOURCES ${my_src}) if (${HAS_FLOW_SUPPORT}) ################################################################################ # EEZ Framework - add_definitions(-DEEZ_PLATFORM_SIMULATOR) add_definitions(-DEEZ_FOR_LVGL) - add_definitions(-DEEZ_OPTION_GUI=0) include_directories( - ./ - ./eez/libs/agg - ./eez/platform/simulator - ./src/conf + ./eez-framework/src + ./eez-framework/src/eez/libs/agg + ./eez-framework/src/eez/platform/simulator ) file(GLOB_RECURSE src_eez - ./eez/*.cpp - ./eez/*.c + ./eez-framework/src/eez/*.cpp + ./eez-framework/src/eez/*.c ) list(APPEND SOURCES ${src_eez}) diff --git a/eez b/eez deleted file mode 160000 index 3051f99..0000000 --- a/eez +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3051f99c87634240d3e7af3c58d9f7594b267519 diff --git a/eez-framework b/eez-framework new file mode 160000 index 0000000..e67a5a5 --- /dev/null +++ b/eez-framework @@ -0,0 +1 @@ +Subproject commit e67a5a5008f34d6d19b08131e0807438998dfdc5 diff --git a/lvgl-template-web.eez-project b/lvgl-template-web.eez-project index bfe4d84..98c5b5b 100644 --- a/lvgl-template-web.eez-project +++ b/lvgl-template-web.eez-project @@ -1,5 +1,10 @@ { "objID": "6666cd76-f969-5646-9e7b-e39d750cc7d9", + "lvglStyles": { + "objID": "a31bd004-35c5-b3fb-5c8b-78ea5c7693b8", + "styles": [], + "defaultStyles": {} + }, "settings": { "objID": "e007d988-9fba-797d-72e9-efc33ca6d05c", "general": { @@ -23,7 +28,7 @@ { "objID": "05204dce-0fc5-4c81-b733-2ccc8e6c8671", "fileName": "screens.h", - "template": "#ifndef EEZ_LVGL_UI_SCREENS_H\r\n#define EEZ_LVGL_UI_SCREENS_H\r\n\r\n#include \"lvgl/lvgl.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n//${eez-studio LVGL_SCREENS_DECL}\r\n//${eez-studio LVGL_SCREENS_DECL_EXT}\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif /*EEZ_LVGL_UI_SCREENS_H*/" + "template": "#ifndef EEZ_LVGL_UI_SCREENS_H\r\n#define EEZ_LVGL_UI_SCREENS_H\r\n\r\n//${eez-studio LVGL_INCLUDE}\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n//${eez-studio LVGL_SCREENS_DECL}\r\n//${eez-studio LVGL_SCREENS_DECL_EXT}\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif /*EEZ_LVGL_UI_SCREENS_H*/" }, { "objID": "2212bc5e-cf4a-4a81-c9ab-a671066d086f", @@ -33,7 +38,7 @@ { "objID": "19d3d573-88a3-4550-f4da-753b61d7f0c4", "fileName": "actions.h", - "template": "#ifndef EEZ_LVGL_UI_EVENTS_H\r\n#define EEZ_LVGL_UI_EVENTS_H\r\n\r\n#include \"lvgl/lvgl.h\"\r\n\r\n//${eez-studio LVGL_ACTIONS_DECL}\r\n\r\n#endif /*EEZ_LVGL_UI_EVENTS_H*/" + "template": "#ifndef EEZ_LVGL_UI_EVENTS_H\r\n#define EEZ_LVGL_UI_EVENTS_H\r\n\r\n//${eez-studio LVGL_INCLUDE}\r\n\r\n//${eez-studio LVGL_ACTIONS_DECL}\r\n\r\n#endif /*EEZ_LVGL_UI_EVENTS_H*/" }, { "objID": "e95514b3-1083-49b9-a4f6-847d4792f050", @@ -53,7 +58,7 @@ { "objID": "81fa9cb7-33e4-4272-9340-49a50037b327", "fileName": "images.h", - "template": "#ifndef EEZ_LVGL_UI_IMAGES_H\r\n#define EEZ_LVGL_UI_IMAGES_H\r\n\r\n#include \"lvgl/lvgl.h\"\r\n\r\n//${eez-studio LVGL_IMAGES_DECL}\r\n\r\n#endif /*EEZ_LVGL_UI_IMAGES_H*/" + "template": "#ifndef EEZ_LVGL_UI_IMAGES_H\r\n#define EEZ_LVGL_UI_IMAGES_H\r\n\r\n//${eez-studio LVGL_INCLUDE}\r\n\r\n//${eez-studio LVGL_IMAGES_DECL}\r\n\r\n#endif /*EEZ_LVGL_UI_IMAGES_H*/" }, { "objID": "5844b3a8-54b7-4bdf-ff04-d052e689328c", @@ -63,7 +68,17 @@ { "objID": "bad0addd-10de-48f7-e57e-b40fce3e7c45", "fileName": "fonts.h", - "template": "#ifndef EEZ_LVGL_UI_FONTS_H\r\n#define EEZ_LVGL_UI_FONTS_H\r\n\r\n#include \"lvgl/lvgl.h\"\r\n\r\n//${eez-studio LVGL_FONTS_DECL}\r\n\r\n#endif /*EEZ_LVGL_UI_FONTS_H*/" + "template": "#ifndef EEZ_LVGL_UI_FONTS_H\r\n#define EEZ_LVGL_UI_FONTS_H\r\n\r\n//${eez-studio LVGL_INCLUDE}\r\n\r\n//${eez-studio LVGL_FONTS_DECL}\r\n\r\n#endif /*EEZ_LVGL_UI_FONTS_H*/" + }, + { + "objID": "4743460c-3867-4a04-9673-213804dc3078", + "fileName": "styles.h", + "template": "#ifndef EEZ_LVGL_UI_STYLES_H\r\n#define EEZ_LVGL_UI_STYLES_H\r\n\r\n//${eez-studio LVGL_INCLUDE}\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n//${eez-studio LVGL_STYLES_DECL}\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif /*EEZ_LVGL_UI_STYLES_H*/" + }, + { + "objID": "d6250de9-847c-4f7f-ed5c-41e7134db9f1", + "fileName": "styles.c", + "template": "#include \"styles.h\"\n#include \"images.h\"\n#include \"fonts.h\"\n\n//${eez-studio LVGL_STYLES_DEF}\n" }, { "objID": "7bc0152a-1716-469c-a3f8-8346707369a1", @@ -76,7 +91,8 @@ "template": "#include \"ui.h\"\n#include \"screens.h\"\n#include \"images.h\"\n#include \"flow_def.h\"\n\nvoid ui_init() {\n eez_flow_init(assets, sizeof(assets), (lv_obj_t **)&objects, sizeof(objects), images, sizeof(images));\n}\n\nvoid ui_tick() {\n eez_flow_tick();\n tick_screen(g_currentScreen);\n}\n" } ], - "destinationFolder": "src/ui" + "destinationFolder": "src/ui", + "lvglInclude": "lvgl/lvgl.h" } }, "variables": { diff --git a/src/conf/eez/conf.h b/src/conf/eez/conf.h deleted file mode 100644 index b63f41d..0000000 --- a/src/conf/eez/conf.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include - -#define OPTION_KEYBOARD 0 -#define OPTION_MOUSE 0 -#define OPTION_KEYPAD 0 - -#define CUSTOM_VALUE_TYPES - - diff --git a/src/ui/actions.h b/src/ui/actions.h index cbbb38d..f631b6d 100644 --- a/src/ui/actions.h +++ b/src/ui/actions.h @@ -1,7 +1,7 @@ #ifndef EEZ_LVGL_UI_EVENTS_H #define EEZ_LVGL_UI_EVENTS_H -#include "lvgl/lvgl.h" +#include diff --git a/src/ui/fonts.h b/src/ui/fonts.h index 35fc793..33defed 100644 --- a/src/ui/fonts.h +++ b/src/ui/fonts.h @@ -1,7 +1,7 @@ #ifndef EEZ_LVGL_UI_FONTS_H #define EEZ_LVGL_UI_FONTS_H -#include "lvgl/lvgl.h" +#include extern const lv_font_t ui_font_small_font; diff --git a/src/ui/images.h b/src/ui/images.h index e47dcec..1f1b8bf 100644 --- a/src/ui/images.h +++ b/src/ui/images.h @@ -1,7 +1,7 @@ #ifndef EEZ_LVGL_UI_IMAGES_H #define EEZ_LVGL_UI_IMAGES_H -#include "lvgl/lvgl.h" +#include extern const lv_img_dsc_t img_log_eez; extern const lv_img_dsc_t img_logo_lvgl; diff --git a/src/ui/screens.c b/src/ui/screens.c index 9c329a7..c94dec9 100644 --- a/src/ui/screens.c +++ b/src/ui/screens.c @@ -103,6 +103,10 @@ void tick_screen_main() { void create_screens() { + lv_disp_t *dispp = lv_disp_get_default(); + lv_theme_t *theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), false, LV_FONT_DEFAULT); + lv_disp_set_theme(dispp, theme); + create_screen_main(); } diff --git a/src/ui/screens.h b/src/ui/screens.h index c3b6a46..c58df68 100644 --- a/src/ui/screens.h +++ b/src/ui/screens.h @@ -1,7 +1,7 @@ #ifndef EEZ_LVGL_UI_SCREENS_H #define EEZ_LVGL_UI_SCREENS_H -#include "lvgl/lvgl.h" +#include #ifdef __cplusplus extern "C" { diff --git a/src/ui/styles.c b/src/ui/styles.c new file mode 100644 index 0000000..f623356 --- /dev/null +++ b/src/ui/styles.c @@ -0,0 +1,5 @@ +#include "styles.h" +#include "images.h" +#include "fonts.h" + + diff --git a/src/ui/styles.h b/src/ui/styles.h new file mode 100644 index 0000000..800a3ee --- /dev/null +++ b/src/ui/styles.h @@ -0,0 +1,16 @@ +#ifndef EEZ_LVGL_UI_STYLES_H +#define EEZ_LVGL_UI_STYLES_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + + +#ifdef __cplusplus +} +#endif + +#endif /*EEZ_LVGL_UI_STYLES_H*/ \ No newline at end of file