diff --git a/env_support/cmake/esp.cmake b/env_support/cmake/esp.cmake index e600d58ef..b871a8700 100644 --- a/env_support/cmake/esp.cmake +++ b/env_support/cmake/esp.cmake @@ -40,7 +40,8 @@ else() idf_component_register(SRCS ${SOURCES} ${EXAMPLE_SOURCES} ${DEMO_SOURCES} INCLUDE_DIRS ${LVGL_ROOT_DIR} ${LVGL_ROOT_DIR}/src ${LVGL_ROOT_DIR}/../ - ${LVGL_ROOT_DIR}/examples ${LVGL_ROOT_DIR}/demos) + ${LVGL_ROOT_DIR}/examples ${LVGL_ROOT_DIR}/demos + REQUIRES esp_timer) endif() target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE") diff --git a/lv_conf_template.h b/lv_conf_template.h index b8c246c4c..8cd1426e5 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -89,6 +89,9 @@ #if LV_TICK_CUSTOM #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ + /*If using lvgl as ESP32 component*/ + // #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h" + // #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL)) #endif /*LV_TICK_CUSTOM*/ /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 97807fe37..80b9b86cf 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -253,6 +253,9 @@ #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ #endif #endif + /*If using lvgl as ESP32 component*/ + // #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h" + // #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL)) #endif /*LV_TICK_CUSTOM*/ /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.