diff --git a/include/lv_conf.h b/include/lv_conf.h index a0eb8507..c8cb2da5 100644 --- a/include/lv_conf.h +++ b/include/lv_conf.h @@ -6,7 +6,7 @@ #ifdef LV_THEME_DEFAULT_FLAG -#define lv_task_handler lv_timer_handler +//#define lv_task_handler lv_timer_handler #define lv_obj_set_click(obj, en) \ ((en) ? lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE) : lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE)) diff --git a/include/lv_conf_v8.h b/include/lv_conf_v8.h index 6c076115..e6ea413f 100644 --- a/include/lv_conf_v8.h +++ b/include/lv_conf_v8.h @@ -15,13 +15,21 @@ #include +#if defined(ARDUINO_ARCH_ESP8266) +#define LV_HIGH_RESOURCE_MCU 0 +#endif + +#ifndef LV_HIGH_RESOURCE_MCU +#define LV_HIGH_RESOURCE_MCU 1 +#endif + /*==================== Graphical settings *====================*/ /* Maximal horizontal and vertical resolution to support by the library.*/ -#define LV_HOR_RES_DEF (480) -#define LV_VER_RES_DEF (320) +#define LV_HOR_RES_DEF (TFT_WIDTH) +#define LV_VER_RES_DEF (TFT_HEIGHT) #define LV_HOR_RES_MAX (TFT_WIDTH) #define LV_VER_RES_MAX (TFT_HEIGHT) @@ -157,7 +165,7 @@ typedef void * lv_anim_user_data_t; #endif /* 1: Enable shadow drawing on rectangles*/ -#define LV_USE_SHADOW 1 +#define LV_USE_SHADOW (LV_HIGH_RESOURCE_MCU) #if LV_USE_SHADOW /* Allow buffering some shadow calculation * LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, @@ -383,12 +391,12 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i * https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_8 0 #define LV_FONT_MONTSERRAT_10 0 -#define LV_FONT_MONTSERRAT_12 1 +#define LV_FONT_MONTSERRAT_12 (LV_HIGH_RESOURCE_MCU) #define LV_FONT_MONTSERRAT_14 0 -#define LV_FONT_MONTSERRAT_16 1 +#define LV_FONT_MONTSERRAT_16 (LV_HIGH_RESOURCE_MCU) #define LV_FONT_MONTSERRAT_18 0 #define LV_FONT_MONTSERRAT_20 0 -#define LV_FONT_MONTSERRAT_22 1 +#define LV_FONT_MONTSERRAT_22 (LV_HIGH_RESOURCE_MCU) #define LV_FONT_MONTSERRAT_24 0 #define LV_FONT_MONTSERRAT_26 0 #define LV_FONT_MONTSERRAT_28 0 @@ -414,6 +422,9 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i #define LV_FONT_UNSCII_8 0 #define LV_FONT_UNSCII_16 0 +/*Custom font*/ +#define UNSCII_8_ICON 1 + /* Optionally declare your custom fonts here. * You can use these fonts as default font too * and they will be available globally. E.g. @@ -485,10 +496,17 @@ typedef void * lv_font_user_data_t; #define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(0x01a2b1) #define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(0x44d1b6) #define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT +#if LV_HIGH_RESOURCE_MCU #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_12 #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16 #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_22 #define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_22 //&lv_font_montserrat_28_compressed +#else +#define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12 +#define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16 +#define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT // &lv_font_montserrat_22 +#define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT // &lv_font_montserrat_28_compressed +#endif /*================= * Text settings diff --git a/platformio.ini b/platformio.ini index a8bf5690..25d0d179 100644 --- a/platformio.ini +++ b/platformio.ini @@ -63,16 +63,16 @@ build_flags = ; -- Shared library dependencies in all environments lib_deps = - ;https://github.com/fvanroie/lvgl.git#dev ; lvgl 8.0.0 dev - ;https://github.com/fvanroie/lv_components ;lvgl widgets 8.0.0 + https://github.com/fvanroie/lvgl.git#dev ; lvgl 8.0.0 dev + https://github.com/fvanroie/lv_components ;lvgl widgets 8.0.0 - lvgl/lvgl @ ^7.7.2 ; from PIO library - ;bodmer/TFT_eSPI @ ^2.3.4 ; Tft SPI drivers + ;lvgl/lvgl @ ^7.7.2 ; from PIO library + bodmer/TFT_eSPI @ ^2.3.4 ; Tft SPI drivers bxparks/AceButton @ ^1.7.1 ; GPIO button library bblanchon/ArduinoJson @ ^6.17.2 ; Json(l) parser bblanchon/StreamUtils @ 1.6.0 ; for EEPromStream knolleary/PubSubClient @ ^2.8.0 ; MQTT client - https://github.com/Bodmer/TFT_eSPI.git ; ^2.3.5 needed for DMA + ;https://github.com/Bodmer/TFT_eSPI.git ; ^2.3.5 needed for DMA https://github.com/fvanroie/ConsoleInput.git https://github.com/andrethomas/TasmotaSlave.git ; ------ Unused / Test libraries