From c67676bb75201b996e41099bafa405348543b73f Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Sat, 7 Oct 2023 21:36:44 +0200 Subject: [PATCH] - Removed LVGL debug settings - Removed clock screen --- include/lv_conf.h | 4 ++-- src/main.cpp | 51 +---------------------------------------------- 2 files changed, 3 insertions(+), 52 deletions(-) diff --git a/include/lv_conf.h b/include/lv_conf.h index 03510ed..0531bd9 100644 --- a/include/lv_conf.h +++ b/include/lv_conf.h @@ -266,14 +266,14 @@ *-----------*/ /*1: Show CPU usage and FPS count*/ -#define LV_USE_PERF_MONITOR 1 +#define LV_USE_PERF_MONITOR 0 #if LV_USE_PERF_MONITOR #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT #endif /*1: Show the used memory and the memory fragmentation * Requires LV_MEM_CUSTOM = 0*/ -#define LV_USE_MEM_MONITOR 1 +#define LV_USE_MEM_MONITOR 0 #if LV_USE_MEM_MONITOR #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT #endif diff --git a/src/main.cpp b/src/main.cpp index 5721a88..0fd4d71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,19 +58,6 @@ std::list flights; // Flight to display std::list::const_iterator it = flights.cbegin(); -// Variables for Clock -int last_minute = -1; - -typedef enum display_state -{ - display_airtraffic, - display_time, - display_info -} display_state_t; - -// Current display state -display_state_t display_state = display_state_t::display_airtraffic; - void send_content_gzip(const unsigned char *content, size_t length, const char *mime_type) { server.sendHeader("Content-encoding", "gzip"); @@ -648,34 +635,6 @@ void display_flights() } } -void display_clock() -{ - struct tm timeinfo; - getLocalTime(&timeinfo); - if (timeinfo.tm_min != last_minute) - { - last_minute = timeinfo.tm_min; - log_i("Updating clock"); - - lv_obj_clean(lv_scr_act()); - - if (time_valid()) - { - auto label_date = lv_label_create(lv_scr_act()); - lv_label_set_text(label_date, get_localtime("%F").c_str()); - lv_obj_set_style_text_font(label_date, &lv_font_montserrat_22, LV_STATE_DEFAULT); - lv_obj_align(label_date, LV_ALIGN_TOP_MID, 0, 0); - auto label_time = lv_label_create(lv_scr_act()); - lv_label_set_text(label_time, get_localtime("%R").c_str()); - lv_obj_set_style_text_font(label_time, &lv_font_montserrat_22, LV_STATE_DEFAULT); - lv_obj_align(label_time, LV_ALIGN_CENTER, 0, 0); - auto label_timezone = lv_label_create(lv_scr_act()); - lv_label_set_text(label_timezone, iotWebParamTimeZone.value()); - lv_obj_align(label_timezone, LV_ALIGN_BOTTOM_MID, 0, 0); - } - } -} - void loop() { // LVGL @@ -700,15 +659,7 @@ void loop() break; case iotwebconf::NetworkState::OnLine: - switch (display_state) - { - case display_state_t::display_airtraffic: - display_flights(); - break; - case display_state_t::display_time: - display_clock(); - break; - } + display_flights(); break; }