From d505c2fa97b66c2dc717ea20339c00537b7025b2 Mon Sep 17 00:00:00 2001 From: Marc Pasteur Date: Sun, 15 Feb 2026 23:26:41 +0100 Subject: [PATCH] nettoyage --- components/domotic_display/ihm.c | 26 +++++++++++------- components/domotic_display/ihm_gateway.c | 2 +- main/main.c | 35 ++++-------------------- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/components/domotic_display/ihm.c b/components/domotic_display/ihm.c index 77c9ea2..ae5e336 100644 --- a/components/domotic_display/ihm.c +++ b/components/domotic_display/ihm.c @@ -154,6 +154,7 @@ static void create_ui(void*) drawHome(); // écran Home // chart, labels, boutons, etc. // par exemple : lblEtatMachine, lblHauteurCuve, myChart, ser... + } // draw_ihm.c @@ -168,16 +169,18 @@ void drawIhm(void *param) { // Init queue //ihm_gateway_init(); - - lv_async_call(create_ui,NULL); + bsp_display_lock(0); + //lv_async_call(create_ui,NULL); + create_ui(NULL); + bsp_display_unlock(); // Loop unifiée while (1) { ihm_gateway_process_queue(); - uint32_t idle_time = lv_timer_handler(); + //uint32_t idle_time = lv_timer_handler(); // ESP32 : task FreeRTOS - vTaskDelay(500 / portTICK_PERIOD_MS); + //vTaskDelay(500 / portTICK_PERIOD_MS); } } @@ -240,9 +243,12 @@ void init_display_ihm(){ } }; ESP_LOGE(TAG,"On demarre le display"); - bsp_display_start(); + lv_display_t *dsp = bsp_display_start(); //lv_display_t *dsp = bsp_display_start_with_config(&cfg); - //bsp_display_rotate(dsp,LV_DISP_ROTATION_180); + + /*bsp_display_lock(0); + bsp_display_rotate(dsp,LV_DISP_ROTATION_90); + bsp_display_unlock();*/ bsp_display_backlight_on(); bsp_display_brightness_set(50); @@ -1655,13 +1661,13 @@ void messageCardContent(lv_obj_t *cont_messages) // lv_obj_add_style(date, &c->fonts[FONT_HEADING_MD], 0); // lv_obj_add_style(date, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT], 0); lv_span_t *day = lv_spangroup_add_span(date); - lv_span_set_text(day, "19/"); + lv_span_set_text(day, "--"); lv_style_set_text_font(lv_span_get_style(day), &super_malibu_80); lv_style_set_text_color(lv_span_get_style(day), base); lv_style_set_line_color(lv_span_get_style(day), lv_color_black()); lv_style_set_line_width(lv_span_get_style(day), 2); lv_span_t *month = lv_spangroup_add_span(date); - lv_span_set_text(month, "12"); + lv_span_set_text(month, "--"); lv_style_set_text_font(lv_span_get_style(month), &super_malibu_80); lv_obj_t *time = lv_spangroup_create(date_and_time); @@ -1669,10 +1675,10 @@ void messageCardContent(lv_obj_t *cont_messages) lv_obj_set_id(time, "time"); // lv_obj_add_style(time, &txtstyle, 0); lv_span_t *hourSpan = lv_spangroup_add_span(time); - lv_span_set_text(hourSpan, "21"); + lv_span_set_text(hourSpan, "--"); lv_style_set_text_font(lv_span_get_style(hourSpan), &super_malibu_80); lv_span_t *minute = lv_spangroup_add_span(time); - lv_span_set_text(minute, ":56"); + lv_span_set_text(minute, ":--"); lv_style_set_text_color(lv_span_get_style(minute), base); lv_style_set_line_color(lv_span_get_style(minute), accent); lv_style_set_text_font(lv_span_get_style(minute), &super_malibu_80); diff --git a/components/domotic_display/ihm_gateway.c b/components/domotic_display/ihm_gateway.c index 5711ee1..c8ca3f9 100644 --- a/components/domotic_display/ihm_gateway.c +++ b/components/domotic_display/ihm_gateway.c @@ -48,7 +48,7 @@ void ihm_gateway_process_queue(void) { if (!evt) return; UBaseType_t pending = uxQueueMessagesWaiting(xIHMEventQueue); - ESP_LOGV(TAG,"Evt recu %d. La queue comporte %d éléments à traiter", evt->eEventType, pending); + ESP_LOGE(TAG,"Evt recu %d. La queue comporte %d éléments à traiter", evt->eEventType, pending); lv_async_call(traiteEvt, evt); } diff --git a/main/main.c b/main/main.c index 688ee54..6f91c8c 100644 --- a/main/main.c +++ b/main/main.c @@ -72,37 +72,14 @@ static void wifiStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject); -lv_subject_t mqttStatus; +//lv_subject_t mqttStatus; //lv_subject_t wifiStatus; -extern lv_subject_t tempIntSubj; +/*extern lv_subject_t tempIntSubj; extern lv_subject_t tempExtSubj; extern lv_subject_t hauteurCuveSubj; extern lv_subject_t hauteurCuveEvolSubj; - -void init_display(){ -/* lvgl_port_cfg_t lvgl_cfg = ESP_LVGL_PORT_INIT_CONFIG(); - lvgl_cfg.task_priority=15; - bsp_display_cfg_t cfg = { - .lvgl_port_cfg = lvgl_cfg, - .buffer_size = 1024*600,//BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = 1, - .flags = { - .buff_dma = false, - .buff_spiram = false, - .sw_rotate = true - } - }; - ESP_LOGE(TAG,"On demarre le display"); - lv_display_t *dsp = bsp_display_start_with_config(&cfg); - //bsp_display_rotate(dsp,LV_DISP_ROTATION_180); - - bsp_display_backlight_on(); - bsp_display_brightness_set(50); - - mainState.display_init=true; - */ -} +*/ /** * @brief i2c master initialization @@ -901,7 +878,7 @@ void app_main(void) ihm_gateway_init(); startEvtManager(); - //boucleMeteo(); + boucleMeteo(); #if CONFIG_IDF_TARGET_LINUX // en mode linux on simule l'obtention de la connexion wifi @@ -932,7 +909,7 @@ void boucleMeteo() on_weather_data_retrieval(weather_data_retreived); on_weather_data_retrieval_start(weather_data_retreived_start); ESP_LOGW(TAG, "Weather data retrieval initialized"); - initialise_weather_data_retrieval(600000, domotic_event_group); + initialise_weather_data_retrieval(600000, domotic_event_group); // On recupere la meteo toutes les 10mn } void app_main1(void) @@ -944,7 +921,7 @@ void app_main1(void) startEvtManager(); - init_display(); + //init_display(); /* const esp_timer_create_args_t periodic_timer_args = { .callback = &presence_timer_callback, // name is optional, but may help identify the timer when debugging