diff --git a/Devices/m5stack-tab5/Source/Configuration.cpp b/Devices/m5stack-tab5/Source/Configuration.cpp index 4ce59117..1d31ba39 100644 --- a/Devices/m5stack-tab5/Source/Configuration.cpp +++ b/Devices/m5stack-tab5/Source/Configuration.cpp @@ -142,7 +142,7 @@ static error_t initSound(::Device* i2c_controller) { constexpr auto IO_EXPANDER1_ADDRESS = 0x43; constexpr auto AMP_REGISTER = 0x05; // Note: to disable the amplifier, reset the bits - error = i2c_controller_register8_set_bits(i2c_controller, IO_EXPANDER1_ADDRESS, AMP_REGISTER, 0b00000010 , pdMS_TO_TICKS(100)); + error = i2c_controller_register8_set_bits(i2c_controller, IO_EXPANDER1_ADDRESS, AMP_REGISTER, 0b00000010, pdMS_TO_TICKS(100)); if (error != ERROR_NONE) { LOG_E(TAG, "Failed to enable amplifier: %s", error_to_string(error)); return error; @@ -156,7 +156,7 @@ static bool initBoot() { check(i2c0, "i2c0 not found"); auto error = initPower(i2c0); - if (initPower(i2c0) != ERROR_NONE) { + if (error != ERROR_NONE) { return false; } diff --git a/Modules/lvgl-module/CMakeLists.txt b/Modules/lvgl-module/CMakeLists.txt index 6c6484e8..f0afa8aa 100644 --- a/Modules/lvgl-module/CMakeLists.txt +++ b/Modules/lvgl-module/CMakeLists.txt @@ -14,7 +14,6 @@ if (DEFINED ENV{ESP_IDF_VERSION}) GET_PROPERTY_VALUE(sdkconfig_text "CONFIG_TT_LVGL_STATUSBAR_ICON_SIZE" statusbar_symbol_size) GET_PROPERTY_VALUE(sdkconfig_text "CONFIG_TT_LVGL_LAUNCHER_ICON_SIZE" launcher_symbol_size) GET_PROPERTY_VALUE(sdkconfig_text "CONFIG_TT_LVGL_SHARED_ICON_SIZE" shared_symbol_size) - GET_PROPERTY_VALUE(sdkconfig_text "CONFIG_TT_LVGL_SHARED_ICON_SIZE" shared_symbol_size) else () # Default values for simulator set(font_size_small 10) @@ -47,16 +46,19 @@ READ_PROPERTIES_TO_MAP( # Read UI density GET_VALUE_FROM_MAP(device_properties "[lvgl]uiDensity" ui_density) # Define UiDensity enum value -if (ui_scale) - if (ui_scale == "default") - set(ui_density "LVGL_UI_DENSITY_DEFAULT") - elif (ui_scale == "compact") - set(ui_density "LVGL_UI_DENSITY_COMPACT") +if (ui_density) + if (ui_density STREQUAL "default") + set(ui_density_variable "LVGL_UI_DENSITY_DEFAULT") + elseif (ui_density STREQUAL "compact") + set(ui_density_variable "LVGL_UI_DENSITY_COMPACT") else () message(FATAL_ERROR "Invalid [lvgl]uiDensity: '${ui_density}'. Must be either 'default' or 'compact'") endif () + message("UI density set to '${ui_density}' via properties") else () - set(ui_density "LVGL_UI_DENSITY_DEFAULT") + set(ui_density "default") + set(ui_density_variable "LVGL_UI_DENSITY_DEFAULT") + message("UI density set to default: ${ui_density}") endif () # #################################### @@ -109,5 +111,5 @@ target_compile_definitions(${MODULE_NAME} PUBLIC "-DTT_LVGL_SHARED_FONT_ICON_SIZE=${shared_symbol_size}" "-DTT_LVGL_SHARED_FONT_ICON_SYMBOL=material_symbols_shared_${shared_symbol_size}" # UiDensity - "-DTT_LVGL_UI_DENSITY=${ui_density}" + "-DTT_LVGL_UI_DENSITY=${ui_density_variable}" ) diff --git a/Modules/lvgl-module/include/tactility/lvgl_module.h b/Modules/lvgl-module/include/tactility/lvgl_module.h index 4548305d..4fd5d9fd 100644 --- a/Modules/lvgl-module/include/tactility/lvgl_module.h +++ b/Modules/lvgl-module/include/tactility/lvgl_module.h @@ -97,7 +97,7 @@ bool lvgl_is_running(void); /** * @brief Gets the desired UI density for the target hardware. * The density is defined in the `device.properties` of a hardware device. - * This setting is read by CMakeLists.txt and passed as a target compile definition of the LVLG module. + * This setting is read by CMakeLists.txt and passed as a target compile definition of the LVGL module. * @return the UI density */ enum UiDensity lvgl_get_ui_density(void);