From ce2cf9a9ee2b3da905d6774744b9f188932e317a Mon Sep 17 00:00:00 2001 From: Wang Beihong Date: Sat, 14 Mar 2026 18:10:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20Wi-Fi=20=E5=92=8C=20MQTT=20=E8=BF=9E=E6=8E=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=8F=98=E9=87=8F=EF=BC=8C=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入了新的全局变量,用于跟踪 Wi-Fi 和 MQTT 连接状态。 - 实现了 Wi-Fi 和 MQTT 连接状态的 getter 和 setter 函数。 - 增加了管理网络信息和时间同步的功能。 - 更新了主应用程序逻辑,以反映 UI 中的当前连接状态。 - 改进了 Wi-Fi 连接处理,以定期发布网络信息。 -土壤湿度和空气温度的综合阈值变量被整合到 UI 中。 --- components/sntp_timp/CMakeLists.txt | 3 + components/sntp_timp/include/sntp_timp.h | 20 ++ components/sntp_timp/sntp_timp.c | 157 +++++++++++++ components/ui/.eez-project-build | 4 + components/ui/images.c | 6 +- components/ui/images.h | 6 +- components/ui/screens.c | 221 ++++++++++++++++-- components/ui/screens.h | 10 + .../ui/ui_font_source_han_sans_sc_medium_22.c | 147 ++++++++++-- components/ui/ui_image_mqtt_connected.c | 79 +++++++ components/ui/ui_image_mqtt_disconnected.c | 79 +++++++ components/ui/ui_image_wifi_connect.c | 79 +++++++ components/ui/ui_image_wifi_disconnect.c | 79 +++++++ components/ui/vars.c | 88 +++++++ components/ui/vars.h | 26 ++- components/wifi-connect/wifi-connect.c | 89 +++++++ main/CMakeLists.txt | 2 +- main/main.c | 57 +++++ 18 files changed, 1109 insertions(+), 43 deletions(-) create mode 100644 components/sntp_timp/CMakeLists.txt create mode 100644 components/sntp_timp/include/sntp_timp.h create mode 100644 components/sntp_timp/sntp_timp.c create mode 100644 components/ui/ui_image_mqtt_connected.c create mode 100644 components/ui/ui_image_mqtt_disconnected.c create mode 100644 components/ui/ui_image_wifi_connect.c create mode 100644 components/ui/ui_image_wifi_disconnect.c diff --git a/components/sntp_timp/CMakeLists.txt b/components/sntp_timp/CMakeLists.txt new file mode 100644 index 0000000..119457b --- /dev/null +++ b/components/sntp_timp/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRCS "sntp_timp.c" + INCLUDE_DIRS "include" + REQUIRES esp_timer esp_event esp_netif lwip) diff --git a/components/sntp_timp/include/sntp_timp.h b/components/sntp_timp/include/sntp_timp.h new file mode 100644 index 0000000..ef4ed84 --- /dev/null +++ b/components/sntp_timp/include/sntp_timp.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief 初始化 SNTP 并等待首次对时完成 + * + * @param timeout_ms 等待首次同步的超时时间(毫秒) + * @return esp_err_t ESP_OK 表示已完成同步 + */ +esp_err_t sntp_timp_sync_time(uint32_t timeout_ms); + +#ifdef __cplusplus +} +#endif diff --git a/components/sntp_timp/sntp_timp.c b/components/sntp_timp/sntp_timp.c new file mode 100644 index 0000000..d1336a8 --- /dev/null +++ b/components/sntp_timp/sntp_timp.c @@ -0,0 +1,157 @@ +#include +#include +#include +#include "sntp_timp.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_log.h" +#include "esp_idf_version.h" +#include "esp_sntp.h" +#include "esp_netif_sntp.h" +#include "sys/time.h" +#include "esp_timer.h" + +static const char *TAG = "sntp_timp"; + +#define SNTP_TIME_VALID_UNIX_TS 1700000000 +#define SNTP_WAIT_POLL_MS 200 +#define SNTP_REFRESH_PERIOD_MS 1000 + +extern void set_var_sntp_time(const char *value) __attribute__((weak)); + +static TaskHandle_t s_time_refresh_task = NULL; + +static time_t get_current_time(void); + +static void publish_sntp_time_var(const char *value) +{ + if (set_var_sntp_time != NULL) { + set_var_sntp_time(value); + } +} + +static void format_current_time(char *buffer, size_t buffer_size) +{ + time_t now = get_current_time(); + struct tm timeinfo; + + localtime_r(&now, &timeinfo); + strftime(buffer, buffer_size, "%Y-%m-%d %H:%M:%S", &timeinfo); +} + +static void sntp_time_refresh_task(void *arg) +{ + (void)arg; + + char time_text[32]; + for (;;) { + format_current_time(time_text, sizeof(time_text)); + publish_sntp_time_var(time_text); + vTaskDelay(pdMS_TO_TICKS(SNTP_REFRESH_PERIOD_MS)); + } +} + +// =========================== 时间相关函数 =========================== +static void set_timezone(void) +{ + // 设置中国标准时间(北京时间) + setenv("TZ", "CST-8", 1); + tzset(); + ESP_LOGI(TAG, "时区设置为北京时间 (CST-8)"); +} + +static time_t get_current_time(void) +{ + // 使用POSIX函数获取时间 + return time(NULL); +} + +static void print_current_time(void) +{ + char buffer[64]; + format_current_time(buffer, sizeof(buffer)); + + ESP_LOGI(TAG, "当前时间: %s", buffer); +} + +static esp_err_t start_time_refresh_task_if_needed(void) +{ + if (s_time_refresh_task != NULL) { + return ESP_OK; + } + + BaseType_t ok = xTaskCreate(sntp_time_refresh_task, + "sntp_time", + 3072, + NULL, + 3, + &s_time_refresh_task); + return (ok == pdPASS) ? ESP_OK : ESP_ERR_NO_MEM; +} + +static void configure_sntp_servers(void) +{ + ESP_LOGI(TAG, "初始化SNTP服务"); + +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + esp_sntp_setoperatingmode(SNTP_OPMODE_POLL); + esp_sntp_setservername(0, "cn.pool.ntp.org"); // 中国 NTP 服务器 + esp_sntp_setservername(1, "ntp1.aliyun.com"); // 阿里云 NTP 服务器 +#else + sntp_setoperatingmode(SNTP_OPMODE_POLL); + sntp_setservername(0, "cn.pool.ntp.org"); + sntp_setservername(1, "cn.pool.ntp.org"); + sntp_setservername(2, "ntp1.aliyun.com"); +#endif +} + +static esp_err_t wait_for_time_sync(uint32_t timeout_ms) +{ + int64_t start_ms = esp_timer_get_time() / 1000; + for (;;) { + time_t now = get_current_time(); + if (now >= SNTP_TIME_VALID_UNIX_TS) { + return ESP_OK; + } + + int64_t elapsed_ms = (esp_timer_get_time() / 1000) - start_ms; + if (elapsed_ms >= (int64_t)timeout_ms) { + return ESP_ERR_TIMEOUT; + } + + vTaskDelay(pdMS_TO_TICKS(SNTP_WAIT_POLL_MS)); + } +} + +esp_err_t sntp_timp_sync_time(uint32_t timeout_ms) +{ + if (timeout_ms == 0) { + timeout_ms = 10000; + } + + set_timezone(); + + if (esp_sntp_enabled()) { + esp_sntp_stop(); + } + + configure_sntp_servers(); + esp_sntp_init(); + + esp_err_t ret = wait_for_time_sync(timeout_ms); + if (ret == ESP_OK) { + print_current_time(); + char time_text[32]; + format_current_time(time_text, sizeof(time_text)); + publish_sntp_time_var(time_text); + + esp_err_t task_ret = start_time_refresh_task_if_needed(); + if (task_ret != ESP_OK) { + ESP_LOGW(TAG, "创建时间刷新任务失败: %s", esp_err_to_name(task_ret)); + } + } else { + ESP_LOGW(TAG, "SNTP 对时超时(%lu ms)", (unsigned long)timeout_ms); + } + + return ret; +} diff --git a/components/ui/.eez-project-build b/components/ui/.eez-project-build index 656607a..34e426b 100644 --- a/components/ui/.eez-project-build +++ b/components/ui/.eez-project-build @@ -16,7 +16,11 @@ "ui_image_humi.c", "ui_image_light.c", "ui_image_mois.c", + "ui_image_mqtt_connected.c", + "ui_image_mqtt_disconnected.c", "ui_image_temp.c", + "ui_image_wifi_connect.c", + "ui_image_wifi_disconnect.c", "vars.h" ] } \ No newline at end of file diff --git a/components/ui/images.c b/components/ui/images.c index 721bad4..ef5c0f3 100644 --- a/components/ui/images.c +++ b/components/ui/images.c @@ -1,8 +1,12 @@ #include "images.h" -const ext_img_desc_t images[4] = { +const ext_img_desc_t images[8] = { { "temp", &img_temp }, { "humi", &img_humi }, { "mois", &img_mois }, { "light", &img_light }, + { "wifi_connect", &img_wifi_connect }, + { "wifi_disconnect", &img_wifi_disconnect }, + { "mqtt_connected", &img_mqtt_connected }, + { "mqtt_disconnected", &img_mqtt_disconnected }, }; \ No newline at end of file diff --git a/components/ui/images.h b/components/ui/images.h index 1e1137a..09f11c8 100644 --- a/components/ui/images.h +++ b/components/ui/images.h @@ -11,6 +11,10 @@ extern const lv_img_dsc_t img_temp; extern const lv_img_dsc_t img_humi; extern const lv_img_dsc_t img_mois; extern const lv_img_dsc_t img_light; +extern const lv_img_dsc_t img_wifi_connect; +extern const lv_img_dsc_t img_wifi_disconnect; +extern const lv_img_dsc_t img_mqtt_connected; +extern const lv_img_dsc_t img_mqtt_disconnected; #ifndef EXT_IMG_DESC_T #define EXT_IMG_DESC_T @@ -20,7 +24,7 @@ typedef struct _ext_img_desc_t { } ext_img_desc_t; #endif -extern const ext_img_desc_t images[4]; +extern const ext_img_desc_t images[8]; #ifdef __cplusplus } diff --git a/components/ui/screens.c b/components/ui/screens.c index 01cbbcc..d9e8587 100644 --- a/components/ui/screens.c +++ b/components/ui/screens.c @@ -33,7 +33,7 @@ void create_screen_main() { { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj0 = obj; - lv_obj_set_pos(obj, 16, 0); + lv_obj_set_pos(obj, 16, 53); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); @@ -42,7 +42,7 @@ void create_screen_main() { { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj1 = obj; - lv_obj_set_pos(obj, 129, 2); + lv_obj_set_pos(obj, 129, 55); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); @@ -51,7 +51,7 @@ void create_screen_main() { { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj2 = obj; - lv_obj_set_pos(obj, 16, 77); + lv_obj_set_pos(obj, 16, 128); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); @@ -60,7 +60,7 @@ void create_screen_main() { { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj3 = obj; - lv_obj_set_pos(obj, 129, 79); + lv_obj_set_pos(obj, 129, 130); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); @@ -69,67 +69,67 @@ void create_screen_main() { { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj4 = obj; - lv_obj_set_pos(obj, 16, 38); + lv_obj_set_pos(obj, 4, 88); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); - lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); - lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_26, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xff1afa29), LV_PART_MAIN | LV_STATE_DEFAULT); lv_label_set_text(obj, ""); } { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj5 = obj; - lv_obj_set_pos(obj, 129, 38); + lv_obj_set_pos(obj, 127, 86); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); - lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); - lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_26, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xffd81e06), LV_PART_MAIN | LV_STATE_DEFAULT); lv_label_set_text(obj, ""); } { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj6 = obj; - lv_obj_set_pos(obj, 16, 116); + lv_obj_set_pos(obj, 4, 163); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); - lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); - lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_26, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xff1296db), LV_PART_MAIN | LV_STATE_DEFAULT); lv_label_set_text(obj, ""); } { lv_obj_t *obj = lv_label_create(parent_obj); objects.obj7 = obj; - lv_obj_set_pos(obj, 129, 116); + lv_obj_set_pos(obj, 127, 163); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); - lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); - lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_26, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xff13227a), LV_PART_MAIN | LV_STATE_DEFAULT); lv_label_set_text(obj, ""); } { lv_obj_t *obj = lv_image_create(parent_obj); - lv_obj_set_pos(obj, 72, 27); + lv_obj_set_pos(obj, 72, 78); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_image_set_src(obj, &img_temp); } { lv_obj_t *obj = lv_image_create(parent_obj); - lv_obj_set_pos(obj, 192, 27); + lv_obj_set_pos(obj, 192, 78); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_image_set_src(obj, &img_humi); } { lv_obj_t *obj = lv_image_create(parent_obj); - lv_obj_set_pos(obj, 72, 105); + lv_obj_set_pos(obj, 72, 156); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_image_set_src(obj, &img_mois); } { lv_obj_t *obj = lv_image_create(parent_obj); - lv_obj_set_pos(obj, 192, 105); + lv_obj_set_pos(obj, 192, 156); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_image_set_src(obj, &img_light); } { lv_obj_t *obj = lv_line_create(parent_obj); objects.obj8 = obj; - lv_obj_set_pos(obj, 0, 75); + lv_obj_set_pos(obj, 0, 126); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); static lv_point_precise_t line_points[] = { { 0, 0 }, @@ -141,7 +141,7 @@ void create_screen_main() { { lv_obj_t *obj = lv_line_create(parent_obj); objects.obj9 = obj; - lv_obj_set_pos(obj, 0, 160); + lv_obj_set_pos(obj, 0, 51); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); static lv_point_precise_t line_points[] = { { 0, 0 }, @@ -153,15 +153,100 @@ void create_screen_main() { { lv_obj_t *obj = lv_line_create(parent_obj); objects.obj10 = obj; - lv_obj_set_pos(obj, 120, 0); + lv_obj_set_pos(obj, 122, 51); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); static lv_point_precise_t line_points[] = { { 0, 0 }, - { 0, 160 } + { 0, 154 } }; lv_line_set_points(obj, line_points, 2); lv_obj_set_style_line_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); } + { + lv_obj_t *obj = lv_image_create(parent_obj); + objects.obj17 = obj; + lv_obj_set_pos(obj, 0, 19); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_image_set_src(obj, &img_wifi_connect); + } + { + lv_obj_t *obj = lv_image_create(parent_obj); + objects.obj18 = obj; + lv_obj_set_pos(obj, 0, 19); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_image_set_src(obj, &img_wifi_disconnect); + } + { + lv_obj_t *obj = lv_image_create(parent_obj); + objects.obj19 = obj; + lv_obj_set_pos(obj, 33, 19); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_image_set_src(obj, &img_mqtt_disconnected); + } + { + lv_obj_t *obj = lv_image_create(parent_obj); + objects.obj20 = obj; + lv_obj_set_pos(obj, 33, 19); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_image_set_src(obj, &img_mqtt_connected); + } + { + lv_obj_t *obj = lv_label_create(parent_obj); + objects.obj11 = obj; + lv_obj_set_pos(obj, 0, 3); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xfff8f8f8), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_label_set_text(obj, ""); + } + { + lv_obj_t *obj = lv_label_create(parent_obj); + objects.obj12 = obj; + lv_obj_set_pos(obj, 64, 25); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_18, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_label_set_text(obj, ""); + } + { + lv_obj_t *obj = lv_line_create(parent_obj); + objects.obj13 = obj; + lv_obj_set_pos(obj, 0, 204); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + static lv_point_precise_t line_points[] = { + { 0, 0 }, + { 240, 0 } + }; + lv_line_set_points(obj, line_points, 2); + lv_obj_set_style_line_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); + } + { + lv_obj_t *obj = lv_label_create(parent_obj); + objects.obj14 = obj; + lv_obj_set_pos(obj, 0, 209); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_label_set_text(obj, "阈值(土/光)"); + } + { + lv_obj_t *obj = lv_label_create(parent_obj); + objects.obj15 = obj; + lv_obj_set_pos(obj, 120, 222); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xff1afa29), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_label_set_text(obj, ""); + } + { + lv_obj_t *obj = lv_label_create(parent_obj); + objects.obj16 = obj; + lv_obj_set_pos(obj, 120, 206); + lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_obj_set_style_text_color(obj, lv_color_hex(0xff1296db), LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_font(obj, &lv_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_label_set_text(obj, ""); + } } tick_screen_main(); @@ -204,6 +289,94 @@ void tick_screen_main() { tick_value_change_obj = NULL; } } + { + bool new_val = get_var_wifi_disconnected(); + bool cur_val = lv_obj_has_flag(objects.obj17, LV_OBJ_FLAG_HIDDEN); + if (new_val != cur_val) { + tick_value_change_obj = objects.obj17; + if (new_val) { + lv_obj_add_flag(objects.obj17, LV_OBJ_FLAG_HIDDEN); + } else { + lv_obj_remove_flag(objects.obj17, LV_OBJ_FLAG_HIDDEN); + } + tick_value_change_obj = NULL; + } + } + { + bool new_val = get_var_wifi_connected(); + bool cur_val = lv_obj_has_flag(objects.obj18, LV_OBJ_FLAG_HIDDEN); + if (new_val != cur_val) { + tick_value_change_obj = objects.obj18; + if (new_val) { + lv_obj_add_flag(objects.obj18, LV_OBJ_FLAG_HIDDEN); + } else { + lv_obj_remove_flag(objects.obj18, LV_OBJ_FLAG_HIDDEN); + } + tick_value_change_obj = NULL; + } + } + { + bool new_val = get_var_mqtt_connected(); + bool cur_val = lv_obj_has_flag(objects.obj19, LV_OBJ_FLAG_HIDDEN); + if (new_val != cur_val) { + tick_value_change_obj = objects.obj19; + if (new_val) { + lv_obj_add_flag(objects.obj19, LV_OBJ_FLAG_HIDDEN); + } else { + lv_obj_remove_flag(objects.obj19, LV_OBJ_FLAG_HIDDEN); + } + tick_value_change_obj = NULL; + } + } + { + bool new_val = get_var_mqtt_disconnected(); + bool cur_val = lv_obj_has_flag(objects.obj20, LV_OBJ_FLAG_HIDDEN); + if (new_val != cur_val) { + tick_value_change_obj = objects.obj20; + if (new_val) { + lv_obj_add_flag(objects.obj20, LV_OBJ_FLAG_HIDDEN); + } else { + lv_obj_remove_flag(objects.obj20, LV_OBJ_FLAG_HIDDEN); + } + tick_value_change_obj = NULL; + } + } + { + const char *new_val = get_var_iot_net_info(); + const char *cur_val = lv_label_get_text(objects.obj11); + if (strcmp(new_val, cur_val) != 0) { + tick_value_change_obj = objects.obj11; + lv_label_set_text(objects.obj11, new_val); + tick_value_change_obj = NULL; + } + } + { + const char *new_val = get_var_sntp_time(); + const char *cur_val = lv_label_get_text(objects.obj12); + if (strcmp(new_val, cur_val) != 0) { + tick_value_change_obj = objects.obj12; + lv_label_set_text(objects.obj12, new_val); + tick_value_change_obj = NULL; + } + } + { + const char *new_val = get_var_air_temp_num(); + const char *cur_val = lv_label_get_text(objects.obj15); + if (strcmp(new_val, cur_val) != 0) { + tick_value_change_obj = objects.obj15; + lv_label_set_text(objects.obj15, new_val); + tick_value_change_obj = NULL; + } + } + { + const char *new_val = get_var_soil_mois_num(); + const char *cur_val = lv_label_get_text(objects.obj16); + if (strcmp(new_val, cur_val) != 0) { + tick_value_change_obj = objects.obj16; + lv_label_set_text(objects.obj16, new_val); + tick_value_change_obj = NULL; + } + } } typedef void (*tick_screen_func_t)(); diff --git a/components/ui/screens.h b/components/ui/screens.h index 2e77078..06664c3 100644 --- a/components/ui/screens.h +++ b/components/ui/screens.h @@ -28,6 +28,16 @@ typedef struct _objects_t { lv_obj_t *obj8; lv_obj_t *obj9; lv_obj_t *obj10; + lv_obj_t *obj11; + lv_obj_t *obj12; + lv_obj_t *obj13; + lv_obj_t *obj14; + lv_obj_t *obj15; + lv_obj_t *obj16; + lv_obj_t *obj17; + lv_obj_t *obj18; + lv_obj_t *obj19; + lv_obj_t *obj20; } objects_t; extern objects_t objects; diff --git a/components/ui/ui_font_source_han_sans_sc_medium_22.c b/components/ui/ui_font_source_han_sans_sc_medium_22.c index 2120c61..abf1b9a 100644 --- a/components/ui/ui_font_source_han_sans_sc_medium_22.c +++ b/components/ui/ui_font_source_han_sans_sc_medium_22.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 22 px * Bpp: 8 - * Opts: --bpp 8 --size 22 --no-compress --font ..\09_SourceHanSansSC\OTF\SimplifiedChinese\SourceHanSansSC-Medium.otf --symbols 温湿度光照土壤空气强 --range 32-127 --format lvgl + * Opts: --bpp 8 --size 22 --no-compress --font ..\09_SourceHanSansSC\OTF\SimplifiedChinese\SourceHanSansSC-Medium.otf --symbols 温湿度光照土壤空气强阈值 --range 32-127 --format lvgl ******************************************************************************/ #ifdef __has_include @@ -2278,6 +2278,66 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xfe, 0xff, 0xee, 0x24, 0x0, 0xb, 0x24, 0x0, 0x0, 0x0, 0x4b, 0xc7, 0xf4, 0xbc, 0x29, 0x0, + /* U+503C "值" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x86, 0x66, 0xd, + 0x0, 0x0, 0x0, 0x0, 0x1d, 0xbb, 0xae, 0x6, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x2b, 0xff, 0xf2, 0xe, 0x0, 0x0, + 0x0, 0x0, 0x40, 0xff, 0xdf, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x9c, 0xff, 0x8f, 0x8d, 0xa7, 0xa7, 0xa7, 0xa7, + 0xc4, 0xff, 0xe9, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, + 0x49, 0x0, 0x0, 0x0, 0x0, 0x16, 0xf8, 0xfd, + 0x21, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x0, + 0x0, 0x0, 0x0, 0x80, 0xff, 0xad, 0x0, 0x21, + 0x27, 0x27, 0x27, 0x27, 0xbd, 0xff, 0x63, 0x27, + 0x27, 0x27, 0x27, 0x27, 0x11, 0x0, 0x0, 0x0, + 0x16, 0xee, 0xff, 0x3d, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0xdd, 0xfe, 0x11, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa4, 0xff, + 0xff, 0x13, 0x0, 0x0, 0xbe, 0xf3, 0xf3, 0xf3, + 0xff, 0xff, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0x29, + 0x0, 0x0, 0x0, 0x4f, 0xff, 0xff, 0xff, 0x13, + 0x0, 0x0, 0xc7, 0xff, 0xa7, 0x9f, 0x9f, 0x9f, + 0x9f, 0x9f, 0x9f, 0xe7, 0xff, 0x2b, 0x0, 0x0, + 0x26, 0xf1, 0xff, 0xff, 0xff, 0x13, 0x0, 0x0, + 0xc7, 0xff, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xbf, 0xff, 0x2b, 0x0, 0x0, 0x52, 0xff, + 0xdb, 0xe7, 0xff, 0x13, 0x0, 0x0, 0xc7, 0xff, + 0x95, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0xe2, + 0xff, 0x2b, 0x0, 0x0, 0x0, 0xbe, 0x2d, 0xdb, + 0xff, 0x13, 0x0, 0x0, 0xc7, 0xff, 0xf4, 0xf3, + 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xfc, 0xff, 0x2b, + 0x0, 0x0, 0x0, 0x8, 0x0, 0xdb, 0xff, 0x13, + 0x0, 0x0, 0xc7, 0xff, 0x13, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xbf, 0xff, 0x2b, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xdb, 0xff, 0x13, 0x0, 0x0, + 0xc7, 0xff, 0x89, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, + 0x7f, 0xdf, 0xff, 0x2b, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xdb, 0xff, 0x13, 0x0, 0x0, 0xc7, 0xff, + 0xf4, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xfc, + 0xff, 0x2b, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdb, + 0xff, 0x13, 0x0, 0x0, 0xc7, 0xff, 0x13, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0x2b, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xdb, 0xff, 0x13, + 0x0, 0x0, 0xc7, 0xff, 0x8d, 0x83, 0x83, 0x83, + 0x83, 0x83, 0x83, 0xe0, 0xff, 0x2b, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xdb, 0xff, 0x13, 0x0, 0x0, + 0xc7, 0xff, 0xf8, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, + 0xf7, 0xfd, 0xff, 0x2b, 0x0, 0x0, 0x0, 0x0, + 0x0, 0xdb, 0xff, 0x13, 0x0, 0x0, 0xc7, 0xff, + 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, + 0xff, 0x2b, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdb, + 0xff, 0x13, 0x0, 0x0, 0xc7, 0xff, 0x13, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0x2b, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xdb, 0xff, 0x13, + 0xa2, 0xc7, 0xf3, 0xff, 0xcc, 0xc7, 0xc7, 0xc7, + 0xc7, 0xc7, 0xc7, 0xf1, 0xff, 0xd1, 0xc7, 0x3, + 0x0, 0x0, 0x0, 0xdb, 0xff, 0x13, 0xcf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x3, + /* U+5149 "光" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0x57, 0x57, 0x0, 0x0, 0x0, 0x0, @@ -2863,7 +2923,62 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x1, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, - 0xb, 0xb, 0xb, 0xa + 0xb, 0xb, 0xb, 0xa, + + /* U+9608 "阈" */ + 0x0, 0x0, 0x2c, 0x68, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xec, 0xff, + 0x64, 0x0, 0x1a, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, + 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0x21, + 0x0, 0x0, 0x51, 0xfe, 0xfc, 0x44, 0x1f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x27, 0x0, 0x0, 0x0, 0x86, + 0xff, 0xeb, 0x1e, 0xb, 0xb, 0xb, 0x39, 0x4f, + 0xe, 0xb, 0xb, 0xb, 0xb, 0xec, 0xff, 0x27, + 0x0, 0x0, 0x0, 0x5, 0xce, 0xd9, 0x22, 0x0, + 0x0, 0x0, 0xa4, 0xff, 0x23, 0x8f, 0x1c, 0x0, + 0x0, 0xeb, 0xff, 0x27, 0x21, 0xeb, 0xd9, 0x0, + 0x25, 0x12, 0x0, 0x0, 0x0, 0x0, 0x9a, 0xff, + 0x2b, 0xbe, 0xe4, 0x18, 0x0, 0xeb, 0xff, 0x27, + 0x23, 0xff, 0xeb, 0x0, 0x87, 0x87, 0x87, 0x87, + 0x87, 0x87, 0xcc, 0xff, 0x95, 0x8e, 0xc4, 0x87, + 0xa, 0xeb, 0xff, 0x27, 0x23, 0xff, 0xeb, 0x0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x13, 0xeb, 0xff, 0x27, + 0x23, 0xff, 0xeb, 0x0, 0x17, 0x17, 0x17, 0x17, + 0x17, 0x17, 0x76, 0xff, 0x50, 0x17, 0x17, 0x17, + 0x1, 0xeb, 0xff, 0x27, 0x23, 0xff, 0xeb, 0x0, + 0x22, 0x47, 0x47, 0x47, 0x47, 0x26, 0x4e, 0xff, + 0x53, 0x19, 0xb6, 0x42, 0x0, 0xeb, 0xff, 0x27, + 0x23, 0xff, 0xeb, 0x0, 0x7b, 0xfe, 0xf3, 0xf3, + 0xfe, 0x87, 0x33, 0xff, 0x6b, 0x70, 0xff, 0x43, + 0x0, 0xeb, 0xff, 0x27, 0x23, 0xff, 0xeb, 0x0, + 0x7b, 0xd7, 0x0, 0x0, 0xd7, 0x87, 0x17, 0xff, + 0x8c, 0xc8, 0xea, 0x3, 0x0, 0xeb, 0xff, 0x27, + 0x23, 0xff, 0xeb, 0x0, 0x7b, 0xe2, 0x43, 0x43, + 0xe2, 0x87, 0x0, 0xe8, 0xd3, 0xff, 0x8f, 0x0, + 0x0, 0xeb, 0xff, 0x27, 0x23, 0xff, 0xeb, 0x0, + 0x78, 0xf7, 0xf7, 0xf7, 0xf7, 0x83, 0x0, 0xb0, + 0xff, 0xf5, 0x18, 0x0, 0x0, 0xeb, 0xff, 0x27, + 0x23, 0xff, 0xeb, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1a, 0x2, 0x7e, 0xff, 0x8b, 0x0, 0x8c, + 0x31, 0xeb, 0xff, 0x27, 0x23, 0xff, 0xeb, 0x10, + 0x63, 0x85, 0xa8, 0xcd, 0xf3, 0xff, 0x38, 0xe7, + 0xff, 0xb0, 0x1, 0xe1, 0x66, 0xeb, 0xff, 0x27, + 0x23, 0xff, 0xeb, 0x18, 0xff, 0xff, 0xe0, 0xb2, + 0x84, 0x7d, 0xe2, 0xf2, 0xb9, 0xff, 0xdc, 0xff, + 0x2a, 0xeb, 0xff, 0x27, 0x23, 0xff, 0xeb, 0x0, + 0x39, 0xe, 0x0, 0x0, 0x1a, 0xf1, 0xfc, 0x4b, + 0xc, 0xc8, 0xff, 0xb6, 0x0, 0xeb, 0xff, 0x27, + 0x23, 0xff, 0xeb, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x98, 0x6e, 0x0, 0x0, 0x0, 0x27, 0x8, + 0x0, 0xef, 0xff, 0x24, 0x23, 0xff, 0xeb, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, + 0x0, 0x3e, 0xd0, 0xcb, 0xd6, 0xff, 0xf9, 0x5, + 0x23, 0xff, 0xeb, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xe9, 0xf8, + 0xee, 0xc2, 0x4e, 0x0 }; /*--------------------- @@ -2967,16 +3082,18 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 15885, .adv_w = 99, .box_w = 2, .box_h = 26, .ofs_x = 2, .ofs_y = -6}, {.bitmap_index = 15937, .adv_w = 125, .box_w = 7, .box_h = 23, .ofs_x = 0, .ofs_y = -5}, {.bitmap_index = 16098, .adv_w = 201, .box_w = 12, .box_h = 4, .ofs_x = 0, .ofs_y = 7}, - {.bitmap_index = 16146, .adv_w = 352, .box_w = 22, .box_h = 22, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 16630, .adv_w = 352, .box_w = 20, .box_h = 20, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 17030, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 16146, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 16608, .adv_w = 352, .box_w = 22, .box_h = 22, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 17092, .adv_w = 352, .box_w = 20, .box_h = 20, .ofs_x = 1, .ofs_y = -1}, {.bitmap_index = 17492, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17954, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 18416, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 17954, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 18416, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 18878, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 19340, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19802, .adv_w = 352, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20242, .adv_w = 352, .box_w = 20, .box_h = 21, .ofs_x = 1, .ofs_y = -2} + {.bitmap_index = 19802, .adv_w = 352, .box_w = 22, .box_h = 21, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 20264, .adv_w = 352, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 20704, .adv_w = 352, .box_w = 20, .box_h = 21, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 21124, .adv_w = 352, .box_w = 20, .box_h = 21, .ofs_x = 1, .ofs_y = -2} }; /*--------------------- @@ -2984,8 +3101,8 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { *--------------------*/ static const uint16_t unicode_list_1[] = { - 0x0, 0x5d6, 0x79b, 0xd5d, 0xdf1, 0x1acb, 0x1ce0, 0x1d36, - 0x201e, 0x2931 + 0x0, 0x10d, 0x6e3, 0x8a8, 0xe6a, 0xefe, 0x1bd8, 0x1ded, + 0x1e43, 0x212b, 0x2a3e, 0x45cc }; /*Collect the unicode lists and glyph_id offsets*/ @@ -2996,8 +3113,8 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY }, { - .range_start = 20809, .range_length = 10546, .glyph_id_start = 96, - .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 10, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .range_start = 20540, .range_length = 17869, .glyph_id_start = 96, + .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 12, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; @@ -3021,7 +3138,7 @@ static const uint8_t kern_left_class_mapping[] = 29, 29, 37, 38, 39, 40, 37, 41, 42, 43, 44, 45, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0 + 0, 0, 0, 0 }; /*Map glyph_ids to kern right classes*/ @@ -3040,7 +3157,7 @@ static const uint8_t kern_right_class_mapping[] = 25, 30, 25, 30, 31, 32, 33, 34, 35, 36, 37, 38, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0 + 0, 0, 0, 0 }; /*Kern values between classes*/ diff --git a/components/ui/ui_image_mqtt_connected.c b/components/ui/ui_image_mqtt_connected.c new file mode 100644 index 0000000..7be26a4 --- /dev/null +++ b/components/ui/ui_image_mqtt_connected.c @@ -0,0 +1,79 @@ +#ifdef __has_include + #if __has_include("lvgl.h") + #ifndef LV_LVGL_H_INCLUDE_SIMPLE + #define LV_LVGL_H_INCLUDE_SIMPLE + #endif + #endif +#endif + +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) +#include "lvgl.h" +#elif defined(LV_LVGL_H_INCLUDE_SYSTEM) +#include +#elif defined(LV_BUILD_TEST) +#include "../lvgl.h" +#else +#include "lvgl/lvgl.h" +#endif + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_MQTT_CONNECTED +#define LV_ATTRIBUTE_IMG_MQTT_CONNECTED +#endif + +static const +LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_MQTT_CONNECTED +uint8_t img_mqtt_connected_map[] = { + + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf1,0x0a,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x74,0x0b,0x4d,0x0a,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x0a,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x4d,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x83,0x00,0x83,0x00,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x00,0x83,0x00,0x83,0x00,0x83,0x00,0x83,0x00,0x83,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x74,0x0b,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x4d,0x0a,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x74,0x0b,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xaa,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x01,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x4d,0x0a,0x17,0x0c,0x17,0x0c,0xf1,0x0a,0x00,0x00,0x83,0x00,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x4d,0x0a,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x4d,0x0a,0x83,0x00,0x83,0x00,0x83,0x00,0x83,0x00,0x83,0x00,0xf1,0x0a,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x26,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0x26,0x01,0x83,0x00,0x00,0x00,0x26,0x01,0xaa,0x01,0xaa,0x01,0x83,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x17,0x0c,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0x17,0x0c,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x17,0x0c,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xaa,0x01,0x83,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x74,0x0b,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x26,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x01,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xaa,0x01,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0x83,0x00,0x00,0x00,0x4d,0x0a,0xf1,0x0a,0xf1,0x0a,0x26,0x01,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xf1,0x0a,0xaa,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0x74,0x0b,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0x74,0x0b,0x17,0x0c,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x26,0x01,0xf1,0x0a,0xf1,0x0a,0xaa,0x01,0x00,0x00,0x83,0x00,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xf1,0x0a,0xaa,0x01,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x26,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x01,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x17,0x0c,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0xaa,0x01,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x17,0x0c,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xf1,0x0a,0x26,0x01,0x26,0x01,0x26,0x01,0x26,0x01,0x26,0x01,0x74,0x0b,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x26,0x01,0xaa,0x01,0xaa,0x01,0x26,0x01,0x00,0x00,0x00,0x00,0x26,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0xaa,0x01,0x83,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x26,0x01,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x83,0x00,0x00,0x00,0x26,0x01,0x4d,0x0a,0x4d,0x0a,0x26,0x01,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x74,0x0b,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x74,0x0b,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x17,0x0c,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xaa,0x01,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x17,0x0c,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x01,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x26,0x01,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0xaa,0x01,0x00,0x00,0x00,0x00,0x26,0x01,0x4d,0x0a,0x4d,0x0a,0x26,0x01,0x00,0x00,0x00,0x00,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x74,0x0b,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x4d,0x0a,0x74,0x0b,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x0c,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x17,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x0a,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0xbb,0x14,0x4d,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf1,0x0a,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0x17,0x0c,0xf1,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + +}; + +const lv_image_dsc_t img_mqtt_connected = { + .header = { + .magic = LV_IMAGE_HEADER_MAGIC, + .cf = LV_COLOR_FORMAT_RGB565, + .flags = 0, + .w = 32, + .h = 32, + .stride = 70, + .reserved_2 = 0, + }, + .data_size = sizeof(img_mqtt_connected_map), + .data = img_mqtt_connected_map, + .reserved = NULL, +}; \ No newline at end of file diff --git a/components/ui/ui_image_mqtt_disconnected.c b/components/ui/ui_image_mqtt_disconnected.c new file mode 100644 index 0000000..6c27b29 --- /dev/null +++ b/components/ui/ui_image_mqtt_disconnected.c @@ -0,0 +1,79 @@ +#ifdef __has_include + #if __has_include("lvgl.h") + #ifndef LV_LVGL_H_INCLUDE_SIMPLE + #define LV_LVGL_H_INCLUDE_SIMPLE + #endif + #endif +#endif + +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) +#include "lvgl.h" +#elif defined(LV_LVGL_H_INCLUDE_SYSTEM) +#include +#elif defined(LV_BUILD_TEST) +#include "../lvgl.h" +#else +#include "lvgl/lvgl.h" +#endif + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_MQTT_DISCONNECTED +#define LV_ATTRIBUTE_IMG_MQTT_DISCONNECTED +#endif + +static const +LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_MQTT_DISCONNECTED +uint8_t img_mqtt_disconnected_map[] = { + + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xa0,0xa0,0x60,0x68,0x20,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x68,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x60,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x20,0x18,0x20,0x18,0x20,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x18,0x20,0x18,0x20,0x18,0x20,0x18,0x20,0x18,0x20,0x18,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xa0,0xa0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x60,0x68,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xa0,0xa0,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x40,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x30,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x60,0x68,0xc0,0xb8,0xc0,0xb8,0x80,0x80,0x00,0x00,0x20,0x18,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0x60,0x68,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x60,0x68,0x20,0x18,0x20,0x18,0x20,0x18,0x20,0x18,0x20,0x18,0x80,0x80,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x20,0x30,0x40,0x50,0x40,0x50,0x40,0x50,0x40,0x50,0x40,0x50,0x20,0x30,0x20,0x18,0x00,0x00,0x20,0x30,0x40,0x50,0x40,0x50,0x20,0x18,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xc0,0xb8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0,0xb8,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xc0,0xb8,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x40,0x50,0x20,0x18,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xa0,0xa0,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x20,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x30,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x40,0x50,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x20,0x18,0x00,0x00,0x60,0x68,0x80,0x80,0x80,0x80,0x20,0x30,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x80,0x80,0x40,0x50,0x40,0x50,0x40,0x50,0x40,0x50,0x40,0x50,0xa0,0xa0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xa0,0xa0,0xc0,0xb8,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x20,0x30,0x80,0x80,0x80,0x80,0x40,0x50,0x00,0x00,0x20,0x18,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x50,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x20,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x30,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xc0,0xb8,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x40,0x50,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xc0,0xb8,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x80,0x80,0x20,0x30,0x20,0x30,0x20,0x30,0x20,0x30,0x20,0x30,0xa0,0xa0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x20,0x30,0x40,0x50,0x40,0x50,0x20,0x30,0x00,0x00,0x00,0x00,0x20,0x30,0x40,0x50,0x40,0x50,0x40,0x50,0x40,0x50,0x40,0x50,0x20,0x18,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x20,0x30,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0x20,0x18,0x00,0x00,0x20,0x30,0x60,0x68,0x60,0x68,0x20,0x30,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xa0,0xa0,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0xa0,0xa0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xc0,0xb8,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x40,0x50,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xc0,0xb8,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x20,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x30,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x20,0x30,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0x40,0x50,0x00,0x00,0x00,0x00,0x20,0x30,0x60,0x68,0x60,0x68,0x20,0x30,0x00,0x00,0x00,0x00,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xa0,0xa0,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0x60,0x68,0xa0,0xa0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xb8,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xc0,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x68,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0xe0,0xd0,0x60,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0xc0,0xb8,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + +}; + +const lv_image_dsc_t img_mqtt_disconnected = { + .header = { + .magic = LV_IMAGE_HEADER_MAGIC, + .cf = LV_COLOR_FORMAT_RGB565, + .flags = 0, + .w = 32, + .h = 32, + .stride = 70, + .reserved_2 = 0, + }, + .data_size = sizeof(img_mqtt_disconnected_map), + .data = img_mqtt_disconnected_map, + .reserved = NULL, +}; \ No newline at end of file diff --git a/components/ui/ui_image_wifi_connect.c b/components/ui/ui_image_wifi_connect.c new file mode 100644 index 0000000..365ccef --- /dev/null +++ b/components/ui/ui_image_wifi_connect.c @@ -0,0 +1,79 @@ +#ifdef __has_include + #if __has_include("lvgl.h") + #ifndef LV_LVGL_H_INCLUDE_SIMPLE + #define LV_LVGL_H_INCLUDE_SIMPLE + #endif + #endif +#endif + +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) +#include "lvgl.h" +#elif defined(LV_LVGL_H_INCLUDE_SYSTEM) +#include +#elif defined(LV_BUILD_TEST) +#include "../lvgl.h" +#else +#include "lvgl/lvgl.h" +#endif + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_WIFI_CONNECT +#define LV_ATTRIBUTE_IMG_WIFI_CONNECT +#endif + +static const +LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_WIFI_CONNECT +uint8_t img_wifi_connect_map[] = { + + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc2,0x18,0x08,0x73,0xca,0x93,0x8c,0xb4,0x4f,0xd5,0x4f,0xd5,0x4f,0xd5,0xca,0x93,0x46,0x5a,0xc2,0x18,0x00,0x00,0x83,0x10,0x07,0x21,0x48,0x29,0x48,0x29,0x48,0x29,0x41,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc2,0x18,0x08,0x73,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x8d,0x5a,0x68,0x31,0x00,0x00,0x41,0x08,0x41,0x08,0x83,0x10,0x8a,0x39,0x07,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x73,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xdd,0x90,0xdd,0x0e,0x9c,0x2d,0x52,0x48,0x29,0x8a,0x39,0x8a,0x39,0x63,0x10,0x83,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0xb4,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x0f,0x9c,0x11,0xee,0x2c,0x7b,0x41,0x08,0x41,0x08,0xc5,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0xb4,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0x90,0xb4,0xac,0x62,0x83,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x73,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x8f,0x83,0x11,0xbd,0x08,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc2,0x18,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0xb6,0x63,0x71,0x7b,0x4f,0xd5,0x84,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xca,0x93,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0x18,0x6c,0xf0,0x62,0x11,0xee,0xca,0x93,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0x18,0x6c,0xf0,0x62,0x11,0xee,0x11,0xee,0x84,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x5a,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0x18,0x6c,0xf0,0x62,0x11,0xee,0x11,0xee,0x46,0x5a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xca,0x93,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0x18,0x6c,0xf0,0x62,0x11,0xee,0x11,0xee,0x8c,0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x4f,0xd5,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0x18,0x6c,0xf0,0x62,0x11,0xee,0x11,0xee,0x8c,0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x4f,0xd5,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x90,0xb4,0x18,0x6c,0xf0,0x62,0x11,0xee,0x11,0xee,0x4f,0xd5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xc4,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x90,0xdd,0x4f,0xa4,0xd6,0x63,0x6f,0x52,0x90,0xdd,0x90,0xdd,0xee,0xc4,0x41,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x41,0x08,0x4d,0x4a,0x71,0x6b,0xb2,0x7b,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xf2,0x83,0xb2,0x7b,0xb0,0x5a,0xb0,0x5a,0xf2,0x83,0xf2,0x83,0xb3,0x73,0x31,0x63,0xcf,0x52,0x41,0x08,0x00,0x00,0x00,0x00,0x00,0x00, + 0x4c,0x4a,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0xde,0xbe,0x7e,0xa6,0x7e,0xa6,0xaf,0x52,0x00,0x00,0x00,0x00,0x00,0x00, + 0xaf,0x5a,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0xde,0xbe,0x7e,0xa6,0x7e,0xa6,0x11,0x5b,0x00,0x00,0x00,0x00,0x00,0x00, + 0xaf,0x5a,0x3e,0xd7,0x3e,0xd7,0xb6,0xac,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0x31,0x73,0xaf,0x72,0xaf,0x72,0xaf,0x72,0xf7,0xa4,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x55,0x94,0x55,0x94,0x3e,0xd7,0x9c,0xc6,0x75,0x94,0xfa,0xb5,0xde,0xbe,0x7e,0xa6,0x7e,0xa6,0x11,0x5b,0x00,0x00,0x00,0x00,0x00,0x00, + 0xaf,0x5a,0x3e,0xd7,0x3e,0xd7,0x11,0x73,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x93,0xfc,0x50,0xeb,0x2f,0xe3,0xef,0xc2,0x55,0x94,0x3e,0xd7,0x3e,0xd7,0x17,0xa5,0x91,0xbb,0x10,0x8b,0xba,0xb5,0x11,0x73,0x32,0xe4,0x10,0x73,0xde,0xbe,0x7e,0xa6,0x7e,0xa6,0x11,0x5b,0x00,0x00,0x00,0x00,0x00,0x00, + 0xaf,0x5a,0x3e,0xd7,0x3e,0xd7,0x11,0x73,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0x71,0xa3,0xcf,0x9a,0xcf,0x9a,0x8e,0x82,0x55,0x94,0x3e,0xd7,0x3e,0xd7,0x7c,0xc6,0xd0,0x72,0x51,0x8b,0x9c,0xc6,0x75,0x94,0x51,0x8b,0xb3,0x83,0xde,0xbe,0x7e,0xa6,0x7e,0xa6,0x11,0x5b,0x00,0x00,0x00,0x00,0x00,0x00, + 0xaf,0x5a,0x3e,0xd7,0x3e,0xd7,0x9c,0xc6,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0xfa,0xb5,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x9c,0xc6,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x9c,0xc6,0x3e,0xd7,0xde,0xbe,0x7e,0xa6,0x7e,0xa6,0x11,0x5b,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf0,0x5a,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0xde,0xbe,0x7e,0xa6,0x7e,0xa6,0xf0,0x5a,0x00,0x00,0x00,0x00,0x00,0x00, + 0xa9,0x39,0xfa,0xb5,0x9c,0xc6,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0x3e,0xd7,0xde,0xbe,0x7e,0xa6,0xf8,0x8c,0xca,0x39,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0x21,0x2d,0x4a,0x2d,0x4a,0x0d,0x4a,0x2e,0x4a,0x2e,0x4a,0x2e,0x4a,0x4e,0x52,0x6f,0x52,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x30,0x73,0x6f,0x52,0x4e,0x52,0x2e,0x4a,0x2e,0x4a,0x2e,0x4a,0x0d,0x4a,0x6e,0x52,0xaf,0x52,0x06,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x18,0x54,0x5b,0x5e,0x7d,0x5e,0x7d,0x5e,0x7d,0x2e,0x4a,0x08,0x73,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0x11,0xee,0xca,0x93,0x2e,0x4a,0xfc,0x74,0x5e,0x7d,0x5e,0x7d,0x54,0x5b,0x83,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xcb,0x39,0x2e,0x42,0x2e,0x42,0x0c,0x3a,0x83,0x10,0x00,0x00,0xc2,0x18,0x46,0x5a,0xca,0x93,0x8c,0xb4,0x4f,0xd5,0x4f,0xd5,0x4f,0xd5,0x8c,0xb4,0x08,0x73,0x00,0x00,0x00,0x00,0x83,0x10,0x0d,0x42,0x2e,0x42,0x2e,0x42,0xcb,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + +}; + +const lv_image_dsc_t img_wifi_connect = { + .header = { + .magic = LV_IMAGE_HEADER_MAGIC, + .cf = LV_COLOR_FORMAT_RGB565, + .flags = 0, + .w = 32, + .h = 32, + .stride = 70, + .reserved_2 = 0, + }, + .data_size = sizeof(img_wifi_connect_map), + .data = img_wifi_connect_map, + .reserved = NULL, +}; \ No newline at end of file diff --git a/components/ui/ui_image_wifi_disconnect.c b/components/ui/ui_image_wifi_disconnect.c new file mode 100644 index 0000000..3a93579 --- /dev/null +++ b/components/ui/ui_image_wifi_disconnect.c @@ -0,0 +1,79 @@ +#ifdef __has_include + #if __has_include("lvgl.h") + #ifndef LV_LVGL_H_INCLUDE_SIMPLE + #define LV_LVGL_H_INCLUDE_SIMPLE + #endif + #endif +#endif + +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) +#include "lvgl.h" +#elif defined(LV_LVGL_H_INCLUDE_SYSTEM) +#include +#elif defined(LV_BUILD_TEST) +#include "../lvgl.h" +#else +#include "lvgl/lvgl.h" +#endif + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMG_WIFI_DISCONNECT +#define LV_ATTRIBUTE_IMG_WIFI_DISCONNECT +#endif + +static const +LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_WIFI_DISCONNECT +uint8_t img_wifi_disconnect_map[] = { + + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0x65,0x29,0x65,0x29,0xa2,0x10,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x42,0xae,0x73,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x71,0x8c,0xeb,0x5a,0x65,0x29,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0x29,0xae,0x73,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x71,0x8c,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0xae,0x73,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xae,0x73,0x28,0x42,0x65,0x29,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0x65,0x29,0xeb,0x5a,0x71,0x8c,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xae,0x73,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xeb,0x5a,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x71,0x8c,0x28,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0x29,0x71,0x8c,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xeb,0x5a,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x71,0x8c,0xf7,0xbd,0xf7,0xbd,0x34,0xa5,0x65,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0x29,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0x71,0x8c,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xa2,0x10,0x71,0x8c,0xf7,0xbd,0xf7,0xbd,0xeb,0x5a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xeb,0x5a,0x34,0xa5,0xf7,0xbd,0x34,0xa5,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00, + 0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0x65,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0x28,0x42,0x34,0xa5,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x34,0xa5,0x71,0x8c,0xeb,0x5a,0xa2,0x10,0x00,0x08,0x00,0x38,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0x29,0x34,0xa5,0xf7,0xbd,0x71,0x8c,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x71,0x8c,0x65,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0x29,0x71,0x8c,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x11,0xd4,0xc9,0xe9,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x01,0x80,0x00,0x10,0x00,0x00,0xa2,0x10,0xae,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0x71,0x8c,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x71,0x8c,0xeb,0x5a,0x65,0x29,0xa2,0x10,0xa2,0x10,0x00,0x00,0x65,0x29,0x45,0x49,0xc5,0xd0,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x01,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0x29,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xae,0x73,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xc8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x42,0xf7,0xbd,0xf7,0xbd,0x34,0xa5,0x65,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x68,0x23,0xf8,0x07,0xf9,0xfc,0xfe,0x11,0xfc,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x07,0xf9,0xf8,0xfd,0xf8,0xfd,0x23,0xf8,0x23,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xa5,0x71,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xd0,0x23,0xf8,0x07,0xf9,0xfc,0xfe,0xff,0xff,0x11,0xfc,0x23,0xf8,0x07,0xf9,0xf8,0xfd,0xff,0xff,0x0e,0xfb,0x23,0xf8,0x23,0xf8,0x01,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0x29,0x28,0x42,0x4a,0x82,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x07,0xf9,0xfc,0xfe,0xff,0xff,0x11,0xfc,0xf8,0xfd,0xff,0xff,0x0e,0xfb,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x02,0xa8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x42,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x6f,0xdb,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x07,0xf9,0xfc,0xfe,0xff,0xff,0xff,0xff,0x0e,0xfb,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0x71,0x8c,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x71,0x8c,0x8b,0xba,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x07,0xf9,0xf8,0xfd,0xff,0xff,0xff,0xff,0x11,0xfc,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0xeb,0x5a,0xa2,0x10,0x00,0x00,0x00,0x00,0x00,0x30,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x07,0xf9,0xf8,0xfd,0xff,0xff,0x11,0xfc,0xfc,0xfe,0xff,0xff,0x11,0xfc,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x02,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xeb,0x5a,0x71,0x8c,0x65,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xd0,0x23,0xf8,0x23,0xf8,0xf8,0xfd,0xff,0xff,0x0e,0xfb,0x23,0xf8,0x07,0xf9,0xfc,0xfe,0xff,0xff,0x11,0xfc,0x23,0xf8,0x23,0xf8,0x01,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x68,0x23,0xf8,0x0a,0xfa,0xff,0xff,0x0e,0xfb,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x07,0xf9,0xfc,0xfe,0x15,0xfd,0x23,0xf8,0x23,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xae,0x73,0x71,0x8c,0x71,0x8c,0x28,0x42,0x43,0xc8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x07,0xf9,0x23,0xf8,0x23,0xf8,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x71,0x8c,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0xf7,0xbd,0x4d,0x83,0x02,0xa8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xa5,0xf7,0xbd,0xf7,0xbd,0x71,0x8c,0x00,0x00,0x00,0x00,0x01,0x48,0x02,0xa8,0x23,0xf8,0x23,0xf8,0x23,0xf8,0x23,0xf0,0x01,0x78,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xa5,0x71,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + +}; + +const lv_image_dsc_t img_wifi_disconnect = { + .header = { + .magic = LV_IMAGE_HEADER_MAGIC, + .cf = LV_COLOR_FORMAT_RGB565, + .flags = 0, + .w = 32, + .h = 32, + .stride = 70, + .reserved_2 = 0, + }, + .data_size = sizeof(img_wifi_disconnect_map), + .data = img_wifi_disconnect_map, + .reserved = NULL, +}; \ No newline at end of file diff --git a/components/ui/vars.c b/components/ui/vars.c index 6afa78b..3765e5b 100644 --- a/components/ui/vars.c +++ b/components/ui/vars.c @@ -46,3 +46,91 @@ void set_var_light_intensity(const char *value) { light_intensity[sizeof(light_intensity) / sizeof(char) - 1] = 0; } +bool wifi_disconnected; + +bool get_var_wifi_disconnected() { + return wifi_disconnected; +} + +void set_var_wifi_disconnected(bool value) { + wifi_disconnected = value; +} + + +bool wifi_connected; + +bool get_var_wifi_connected() { + return wifi_connected; +} + +void set_var_wifi_connected(bool value) { + wifi_connected = value; +} + + +bool mqtt_connected; + +bool get_var_mqtt_connected() { + return mqtt_connected; +} + +void set_var_mqtt_connected(bool value) { + mqtt_connected = value; +} + + +bool mqtt_disconnected; + +bool get_var_mqtt_disconnected() { + return mqtt_disconnected; +} + +void set_var_mqtt_disconnected(bool value) { + mqtt_disconnected = value; +} + + +char iot_net_info[100] = { 0 }; + +const char *get_var_iot_net_info() { + return iot_net_info; +} + +void set_var_iot_net_info(const char *value) { + strncpy(iot_net_info, value, sizeof(iot_net_info) / sizeof(char)); + iot_net_info[sizeof(iot_net_info) / sizeof(char) - 1] = 0; +} + +char sntp_time[100] = { 0 }; + +const char *get_var_sntp_time() { + return sntp_time; +} + +void set_var_sntp_time(const char *value) { + strncpy(sntp_time, value, sizeof(sntp_time) / sizeof(char)); + sntp_time[sizeof(sntp_time) / sizeof(char) - 1] = 0; +} + +char air_temp_num[100] = { 0 }; + +const char *get_var_air_temp_num() { + return air_temp_num; +} + +void set_var_air_temp_num(const char *value) { + strncpy(air_temp_num, value, sizeof(air_temp_num) / sizeof(char)); + air_temp_num[sizeof(air_temp_num) / sizeof(char) - 1] = 0; +} + + +char soil_mois_num[100] = { 0 }; + +const char *get_var_soil_mois_num() { + return soil_mois_num; +} + +void set_var_soil_mois_num(const char *value) { + strncpy(soil_mois_num, value, sizeof(soil_mois_num) / sizeof(char)); + soil_mois_num[sizeof(soil_mois_num) / sizeof(char) - 1] = 0; +} diff --git a/components/ui/vars.h b/components/ui/vars.h index 6114273..ee9d38d 100644 --- a/components/ui/vars.h +++ b/components/ui/vars.h @@ -16,7 +16,15 @@ enum FlowGlobalVariables { FLOW_GLOBAL_VARIABLE_AIR_TEMPERATURE = 0, FLOW_GLOBAL_VARIABLE_AIR_HUMIDITY = 1, FLOW_GLOBAL_VARIABLE_SOIL_MOISTURE = 2, - FLOW_GLOBAL_VARIABLE_LIGHT_INTENSITY = 3 + FLOW_GLOBAL_VARIABLE_LIGHT_INTENSITY = 3, + FLOW_GLOBAL_VARIABLE_WIFI_DISCONNECTED = 4, + FLOW_GLOBAL_VARIABLE_WIFI_CONNECTED = 5, + FLOW_GLOBAL_VARIABLE_MQTT_DISCONNECTED = 6, + FLOW_GLOBAL_VARIABLE_MQTT_CONNECTED = 7, + FLOW_GLOBAL_VARIABLE_IOT_NET_INFO = 8, + FLOW_GLOBAL_VARIABLE_SNTP_TIME = 9, + FLOW_GLOBAL_VARIABLE_AIR_TEMP_NUM = 10, + FLOW_GLOBAL_VARIABLE_SOIL_MOIS_NUM = 11 }; // Native global variables @@ -29,6 +37,22 @@ extern const char *get_var_soil_moisture(); extern void set_var_soil_moisture(const char *value); extern const char *get_var_light_intensity(); extern void set_var_light_intensity(const char *value); +extern bool get_var_wifi_disconnected(); +extern void set_var_wifi_disconnected(bool value); +extern bool get_var_wifi_connected(); +extern void set_var_wifi_connected(bool value); +extern bool get_var_mqtt_disconnected(); +extern void set_var_mqtt_disconnected(bool value); +extern bool get_var_mqtt_connected(); +extern void set_var_mqtt_connected(bool value); +extern const char *get_var_iot_net_info(); +extern void set_var_iot_net_info(const char *value); +extern const char *get_var_sntp_time(); +extern void set_var_sntp_time(const char *value); +extern const char *get_var_air_temp_num(); +extern void set_var_air_temp_num(const char *value); +extern const char *get_var_soil_mois_num(); +extern void set_var_soil_mois_num(const char *value); #ifdef __cplusplus } diff --git a/components/wifi-connect/wifi-connect.c b/components/wifi-connect/wifi-connect.c index 3917b55..d802cd8 100644 --- a/components/wifi-connect/wifi-connect.c +++ b/components/wifi-connect/wifi-connect.c @@ -32,6 +32,9 @@ #define WIFI_CONNECT_NVS_KEY_PASS "pass" #define WIFI_CONNECT_HTTP_BUF_SIZE 256 +#define WIFI_CONNECT_NETINFO_UPDATE_MS 15000 + +#define WIFI_CONNECT_NETINFO_DEFAULT_RSSI_DBM (-127) #ifndef CONFIG_WIFI_CONNECT_BUTTON_STARTUP_GUARD_MS #define CONFIG_WIFI_CONNECT_BUTTON_STARTUP_GUARD_MS 5000 @@ -43,6 +46,8 @@ static const char *TAG = "wifi_connect"; +extern void set_var_iot_net_info(const char *value) __attribute__((weak)); + static inline bool wifi_connect_is_always_on_mode(void) { #if CONFIG_WIFI_CONNECT_PROVISION_MODE_ALWAYS_ON @@ -106,6 +111,7 @@ typedef struct { TaskHandle_t button_task; TaskHandle_t dns_task; + TaskHandle_t net_info_task; SemaphoreHandle_t lock; @@ -127,6 +133,84 @@ static wifi_connect_ctx_t s_ctx = { .dns_sock = -1, }; +static void wifi_connect_publish_iot_net_info(const char *info) +{ + if (set_var_iot_net_info != NULL) { + set_var_iot_net_info(info); + } +} + +static void wifi_connect_publish_net_info_disconnected(void) +{ + char info[96] = {0}; + snprintf(info, + sizeof(info), + "RSSI:%ddBm IP:0.0.0.0", + WIFI_CONNECT_NETINFO_DEFAULT_RSSI_DBM); + wifi_connect_publish_iot_net_info(info); +} + +static void wifi_connect_net_info_task(void *arg) +{ + (void)arg; + + for (;;) { + bool connected = false; + xSemaphoreTake(s_ctx.lock, portMAX_DELAY); + connected = s_ctx.sta_connected; + xSemaphoreGive(s_ctx.lock); + + if (!connected) { + wifi_connect_publish_net_info_disconnected(); + vTaskDelay(pdMS_TO_TICKS(WIFI_CONNECT_NETINFO_UPDATE_MS)); + continue; + } + + int8_t rssi_dbm = 0; + bool has_rssi = false; + wifi_ap_record_t ap_info = {0}; + if (esp_wifi_sta_get_ap_info(&ap_info) == ESP_OK) { + rssi_dbm = ap_info.rssi; + has_rssi = true; + } + + esp_netif_ip_info_t ip_info = {0}; + bool has_ip = (esp_netif_get_ip_info(s_ctx.sta_netif, &ip_info) == ESP_OK) && (ip_info.ip.addr != 0); + + char info[96] = {0}; + if (has_rssi) { + if (has_ip) { + snprintf(info, + sizeof(info), + "RSSI:%ddBm IP:" IPSTR, + rssi_dbm, + IP2STR(&ip_info.ip)); + } else { + snprintf(info, + sizeof(info), + "RSSI:%ddBm IP:0.0.0.0", + rssi_dbm); + } + } else { + if (has_ip) { + snprintf(info, + sizeof(info), + "RSSI:%ddBm IP:" IPSTR, + WIFI_CONNECT_NETINFO_DEFAULT_RSSI_DBM, + IP2STR(&ip_info.ip)); + } else { + snprintf(info, + sizeof(info), + "RSSI:%ddBm IP:0.0.0.0", + WIFI_CONNECT_NETINFO_DEFAULT_RSSI_DBM); + } + } + + wifi_connect_publish_iot_net_info(info); + vTaskDelay(pdMS_TO_TICKS(WIFI_CONNECT_NETINFO_UPDATE_MS)); + } +} + // 配网页面(内嵌 HTML + JS) static const char *s_html_page = "" @@ -987,6 +1071,7 @@ static void wifi_connect_event_handler(void *arg, esp_event_base_t event_base, i esp_timer_stop(s_ctx.connect_timer); } xSemaphoreGive(s_ctx.lock); + wifi_connect_publish_net_info_disconnected(); } } @@ -1233,6 +1318,10 @@ esp_err_t wifi_connect_init(void) } s_ctx.initialized = true; + wifi_connect_publish_net_info_disconnected(); + + BaseType_t net_info_ok = xTaskCreate(wifi_connect_net_info_task, "wifi_net_info", 4096, NULL, 3, &s_ctx.net_info_task); + ESP_RETURN_ON_FALSE(net_info_ok == pdPASS, ESP_ERR_NO_MEM, TAG, "net info task create failed"); if (wifi_connect_is_always_on_mode()) { wifi_connect_log_state_i("配网模式", "常驻配网(上电自动开启且不会自动关闭)"); diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index d985457..ad0645d 100755 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,4 +1,4 @@ idf_component_register(SRCS "main.c" "auto_ctrl_thresholds.c" "auto_alerts.c" "status_web.c" INCLUDE_DIRS "." - REQUIRES wifi-connect mqtt_control esp_lvgl_port lvgl_st7789_use i2c_master_messager io_device_control console_simple_init console console_user_cmds capactive_soil_moisture_sensor_V2.0 ui esp_app_format + REQUIRES wifi-connect mqtt_control esp_lvgl_port lvgl_st7789_use i2c_master_messager io_device_control console_simple_init console console_user_cmds capactive_soil_moisture_sensor_V2.0 ui esp_app_format sntp_timp ) diff --git a/main/main.c b/main/main.c index e07afe0..7e5a779 100755 --- a/main/main.c +++ b/main/main.c @@ -19,6 +19,7 @@ #include "auto_alerts.h" #include "mqtt_control.h" // MQTT 控制接口 #include "status_web.h" +#include "sntp_timp.h" // 配置宏定义:BH1750 光照传感器是否启用(默认禁用) #ifndef CONFIG_I2C_MASTER_MESSAGER_BH1750_ENABLE @@ -152,6 +153,31 @@ static void update_status_web_snapshot(void) } } +static void update_ui_threshold_vars(const auto_ctrl_thresholds_t *thresholds) +{ + if (thresholds == NULL) + { + return; + } + + char soil_threshold_text[16] = {0}; + char air_threshold_text[16] = {0}; + + snprintf(soil_threshold_text, + sizeof(soil_threshold_text), + "%.0f~%.0f", + thresholds->pump_on_soil_below_pct, + thresholds->pump_off_soil_above_pct); + snprintf(air_threshold_text, + sizeof(air_threshold_text), + "%.0f~%.0f", + thresholds->light_on_lux_below, + thresholds->light_off_lux_above); + + set_var_soil_mois_num(soil_threshold_text); + set_var_air_temp_num(air_threshold_text); +} + /** * @brief MQTT 控制命令处理函数 * @@ -440,6 +466,9 @@ static void ui_task(void *arg) */ static void wait_for_wifi_connected(void) { + set_var_wifi_disconnected(true); + set_var_wifi_connected(false); + const uint32_t timeout_s = 120; uint32_t elapsed_half_s = 0; @@ -462,9 +491,22 @@ static void wait_for_wifi_connected(void) } } + + set_var_wifi_disconnected(false); + set_var_wifi_connected(true); ESP_LOGI(TAG, "Wi-Fi 已连接,开始初始化 console"); } +/** + * @brief 同步 MQTT 连接状态到 UI 变量 + */ +static void update_mqtt_ui_state(void) +{ + bool mqtt_connected = mqtt_control_is_connected(); + set_var_mqtt_connected(mqtt_connected); + set_var_mqtt_disconnected(!mqtt_connected); +} + /** * @brief 主函数 * @@ -547,9 +589,20 @@ void app_main(void) // 按需求:仅在 Wi-Fi 确认连通后再初始化 MQTT和console。 wait_for_wifi_connected(); + // Wi-Fi 连通后做一次 SNTP 对时,失败不阻断后续业务。 + esp_err_t sntp_ret = sntp_timp_sync_time(12000); + if (sntp_ret != ESP_OK) + { + ESP_LOGW(TAG, "SNTP 对时未完成: %s", esp_err_to_name(sntp_ret)); + } + // 独立状态网页(端口 8080),与配网页面(端口 80)互不干扰。 ESP_ERROR_CHECK(status_web_start(BOTANY_STATUS_WEB_PORT)); + // MQTT 启动前,先给 UI 一个明确的初始状态。 + set_var_mqtt_connected(false); + set_var_mqtt_disconnected(true); + ESP_ERROR_CHECK(mqtt_control_register_command_handler(mqtt_control_command_handler, NULL)); ESP_ERROR_CHECK(mqtt_control_start()); // 启动 MQTT 客户端 @@ -563,6 +616,7 @@ void app_main(void) ESP_ERROR_CHECK(auto_alerts_register_callback(auto_alert_mqtt_callback, NULL)); auto_ctrl_thresholds_t thresholds = {0}; auto_ctrl_thresholds_get(&thresholds); + update_ui_threshold_vars(&thresholds); uint32_t telemetry_elapsed_ms = 0; ESP_LOGI(TAG, @@ -576,8 +630,11 @@ void app_main(void) { s_main_loop_counter++; + update_mqtt_ui_state(); + // 预留给 MQTT 回调动态更新阈值:每个周期读取最新配置。 auto_ctrl_thresholds_get(&thresholds); + update_ui_threshold_vars(&thresholds); bool soil_valid = false; float soil_moisture_pct = 0.0f;