Compare commits
5 Commits
7ec1ed9111
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| bfd2d9afad | |||
| 929f6273e4 | |||
|
|
c46cabe48c | ||
|
|
ce2cf9a9ee | ||
|
|
bec31c01ce |
@@ -1,6 +1,6 @@
|
||||
# BotanicalBuddy
|
||||
|
||||
基于 ESP-IDF 的智能盆栽系统固件项目(ESP32-C3)。
|
||||
基于 ESP-IDF 的智能花卉系统固件项目(ESP32-C3)。
|
||||
|
||||
当前结论:单片机端核心功能已完成,可直接联调 App/小程序侧。
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
- `main/`:业务编排、控制循环、MQTT 回调对接
|
||||
- `components/wifi-connect/`:配网与路由连接
|
||||
- `components/lvgl_st7735s_use/`:LCD 与 LVGL 端口
|
||||
- `components/lvgl_st7789_use/`:LCD 与 LVGL 端口
|
||||
- `components/ui/`:界面对象与变量绑定
|
||||
- `components/i2c_master_messager/`:AHT30、BH1750 采集
|
||||
- `components/capactive_soil_moisture_sensor_V2.0/`:土壤湿度采集
|
||||
|
||||
BIN
Smart-wechatAPP.zip
Normal file
BIN
Smart-wechatAPP.zip
Normal file
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
idf_component_register(SRCS "lvgl_st7735s_use.c"
|
||||
idf_component_register(SRCS "lvgl_st7789_use.c"
|
||||
INCLUDE_DIRS "include"
|
||||
REQUIRES driver esp_lcd esp_lvgl_port
|
||||
)
|
||||
@@ -1,6 +1,6 @@
|
||||
# lvgl_st7735s_use 组件说明
|
||||
# lvgl_st7789_use 组件说明
|
||||
|
||||
`lvgl_st7735s_use` 是项目中的 LCD 显示组件,基于 `esp_lcd + esp_lvgl_port`,用于快速驱动 ST77xx 系列 SPI 屏并显示 LVGL 界面。
|
||||
`lvgl_st7789_use` 是项目中的 LCD 显示组件,基于 `esp_lcd + esp_lvgl_port`,用于快速驱动 ST7789 SPI 屏并显示 LVGL 界面。
|
||||
|
||||
---
|
||||
|
||||
@@ -17,19 +17,19 @@
|
||||
|
||||
## 对外 API
|
||||
|
||||
头文件:`include/lvgl_st7735s_use.h`
|
||||
头文件:`include/lvgl_st7789_use.h`
|
||||
|
||||
- `esp_err_t start_lvgl_demo(void);`
|
||||
- 完成 LCD + LVGL 初始化并创建默认界面
|
||||
|
||||
- `esp_err_t lvgl_st7735s_set_center_text(const char *text);`
|
||||
- `esp_err_t lvgl_st7789_set_center_text(const char *text);`
|
||||
- 运行时更新中心标签文字(线程安全,内部已加锁)
|
||||
|
||||
---
|
||||
|
||||
## 关键配置项(可直接改宏)
|
||||
|
||||
在 `include/lvgl_st7735s_use.h` 中:
|
||||
在 `include/lvgl_st7789_use.h` 中:
|
||||
|
||||
### 1) 屏幕与 SPI
|
||||
|
||||
@@ -38,9 +38,19 @@
|
||||
- `EXAMPLE_LCD_SPI_NUM`
|
||||
- `EXAMPLE_LCD_CMD_BITS` / `EXAMPLE_LCD_PARAM_BITS`
|
||||
|
||||
建议:首次点亮优先用较低时钟(如 `10MHz`),稳定后再升频。
|
||||
建议:ST7789 默认可先用 `20MHz`,如出现花屏或不稳定再降到 `10MHz` 复测。
|
||||
|
||||
### 2) 方向与偏移(重点)
|
||||
### 2) 颜色校准(重点)
|
||||
|
||||
- `EXAMPLE_LCD_COLOR_ORDER_BGR`
|
||||
- `EXAMPLE_LCD_INVERT_COLOR`
|
||||
- `EXAMPLE_LCD_SWAP_BYTES`
|
||||
|
||||
说明:
|
||||
- 出现“黑色发灰、红绿蓝偏紫/互串”时,优先调整这三项。
|
||||
- 建议从 `RGB + 不反色 + 不交换字节` 起步,再逐项切换。
|
||||
|
||||
### 3) 方向与偏移(重点)
|
||||
|
||||
- `EXAMPLE_LCD_GAP_X`
|
||||
- `EXAMPLE_LCD_GAP_Y`
|
||||
@@ -49,10 +59,9 @@
|
||||
- `EXAMPLE_LCD_ROT_MIRROR_Y`
|
||||
|
||||
说明:
|
||||
- 当前项目已验证一组可用参数(顺时针 90° + 26 偏移)。
|
||||
- 若出现“文字偏移/边缘花屏/方向反了”,优先微调上述宏,不要同时在多层重复旋转。
|
||||
|
||||
### 3) 调试项
|
||||
### 4) 调试项
|
||||
|
||||
- `EXAMPLE_LCD_ENABLE_COLOR_TEST`
|
||||
- `1`:上电先画 RGB 三色测试图(便于确认硬件链路)
|
||||
@@ -64,12 +73,12 @@
|
||||
|
||||
```c
|
||||
#include "esp_check.h"
|
||||
#include "lvgl_st7735s_use.h"
|
||||
#include "lvgl_st7789_use.h"
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
ESP_ERROR_CHECK(start_lvgl_demo());
|
||||
ESP_ERROR_CHECK(lvgl_st7735s_set_center_text("BotanicalBuddy"));
|
||||
ESP_ERROR_CHECK(lvgl_st7789_set_center_text("BotanicalBuddy"));
|
||||
}
|
||||
```
|
||||
|
||||
@@ -80,7 +89,7 @@ void app_main(void)
|
||||
### 1) 背光亮但没有内容
|
||||
|
||||
优先排查:
|
||||
- 面板型号与驱动是否匹配(ST7735S / ST7789)
|
||||
- 面板型号与驱动是否匹配(当前应为 ST7789)
|
||||
- SPI 模式、时钟是否过高
|
||||
- 方向/偏移参数是否正确
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* LCD size */
|
||||
/* LCD size (ST7789 240x240) */
|
||||
#define EXAMPLE_LCD_H_RES (240)
|
||||
#define EXAMPLE_LCD_V_RES (240)
|
||||
|
||||
@@ -16,7 +16,7 @@ extern "C" {
|
||||
#define EXAMPLE_LCD_SPI_NUM (SPI2_HOST) // 使用SPI2主机接口进行通信
|
||||
|
||||
/* LCD显示参数配置 */
|
||||
#define EXAMPLE_LCD_PIXEL_CLK_HZ (10 * 1000 * 1000) // 先用10MHz提高兼容性,点亮后再逐步升频
|
||||
#define EXAMPLE_LCD_PIXEL_CLK_HZ (20 * 1000 * 1000) // ST7789常用20MHz,兼顾稳定性与刷新速度
|
||||
|
||||
/* LCD命令和参数配置 */
|
||||
#define EXAMPLE_LCD_CMD_BITS (8) // 命令位数为8位,用于发送LCD控制命令
|
||||
@@ -27,12 +27,17 @@ extern "C" {
|
||||
#define EXAMPLE_LCD_DRAW_BUFF_DOUBLE (1) // 启用双缓冲模式,提高显示流畅度
|
||||
#define EXAMPLE_LCD_DRAW_BUFF_HEIGHT (50) // 绘图缓冲区高度为50行,影响刷新性能
|
||||
|
||||
/* ST7789颜色配置(出现偏色时优先调整这三项) */
|
||||
#define EXAMPLE_LCD_COLOR_ORDER_BGR (0) // 0: RGB, 1: BGR
|
||||
#define EXAMPLE_LCD_INVERT_COLOR (1) // 0: 正常色, 1: 反色
|
||||
#define EXAMPLE_LCD_SWAP_BYTES (1) // 0: 不交换RGB565高低字节, 1: 交换
|
||||
|
||||
/* LCD背光配置 */
|
||||
#define EXAMPLE_LCD_BL_ON_LEVEL (1) // 背光开启电平为高电平(1)
|
||||
|
||||
/* LCD方向/偏移配置(当前为顺时针90°,并保留26偏移) */
|
||||
#define EXAMPLE_LCD_GAP_X (1)
|
||||
#define EXAMPLE_LCD_GAP_Y (26)
|
||||
/* LCD方向/偏移配置 */
|
||||
#define EXAMPLE_LCD_GAP_X (0)
|
||||
#define EXAMPLE_LCD_GAP_Y (0)
|
||||
#define EXAMPLE_LCD_ROT_SWAP_XY (1)
|
||||
#define EXAMPLE_LCD_ROT_MIRROR_X (1)
|
||||
#define EXAMPLE_LCD_ROT_MIRROR_Y (0)
|
||||
@@ -49,7 +54,7 @@ extern "C" {
|
||||
#define EXAMPLE_LCD_GPIO_BL (GPIO_NUM_NC)
|
||||
|
||||
esp_err_t start_lvgl_demo(void);
|
||||
esp_err_t lvgl_st7735s_set_center_text(const char *text);
|
||||
esp_err_t lvgl_st7789_set_center_text(const char *text);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "lvgl_st7735s_use.h"
|
||||
#include "lvgl_st7789_use.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "driver/gpio.h"
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "esp_lcd_panel_ops.h"
|
||||
#include "esp_lvgl_port.h"
|
||||
|
||||
static const char *TAG = "lvgl_st7735s_use";
|
||||
static const char *TAG = "lvgl_st7789_use";
|
||||
|
||||
static esp_lcd_panel_io_handle_t lcd_io = NULL;
|
||||
static esp_lcd_panel_handle_t lcd_panel = NULL;
|
||||
@@ -62,11 +62,15 @@ static esp_err_t app_lcd_init(void)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
gpio_config_t bk_gpio_config = {
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pin_bit_mask = 1ULL << EXAMPLE_LCD_GPIO_BL
|
||||
};
|
||||
ESP_ERROR_CHECK(gpio_config(&bk_gpio_config));
|
||||
if (EXAMPLE_LCD_GPIO_BL != GPIO_NUM_NC) {
|
||||
gpio_config_t bk_gpio_config = {
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pin_bit_mask = 1ULL << EXAMPLE_LCD_GPIO_BL
|
||||
};
|
||||
ESP_ERROR_CHECK(gpio_config(&bk_gpio_config));
|
||||
} else {
|
||||
ESP_LOGW(TAG, "背光引脚未配置(GPIO_NUM_NC),跳过背光GPIO初始化");
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "初始化SPI总线");
|
||||
const spi_bus_config_t buscfg = {
|
||||
@@ -95,9 +99,9 @@ static esp_err_t app_lcd_init(void)
|
||||
const esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = EXAMPLE_LCD_GPIO_RST,
|
||||
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
|
||||
.rgb_endian = LCD_RGB_ENDIAN_RGB,
|
||||
.rgb_endian = EXAMPLE_LCD_COLOR_ORDER_BGR ? LCD_RGB_ENDIAN_BGR : LCD_RGB_ENDIAN_RGB,
|
||||
#else
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
|
||||
.rgb_ele_order = EXAMPLE_LCD_COLOR_ORDER_BGR ? LCD_RGB_ELEMENT_ORDER_BGR : LCD_RGB_ELEMENT_ORDER_RGB,
|
||||
#endif
|
||||
.bits_per_pixel = EXAMPLE_LCD_BITS_PER_PIXEL,
|
||||
};
|
||||
@@ -111,11 +115,18 @@ static esp_err_t app_lcd_init(void)
|
||||
ESP_GOTO_ON_ERROR(esp_lcd_panel_set_gap(lcd_panel, EXAMPLE_LCD_GAP_X, EXAMPLE_LCD_GAP_Y), err, TAG, "设置显示偏移失败");
|
||||
ESP_LOGI(TAG, "面板基准参数已应用: gap=(%d,%d)", EXAMPLE_LCD_GAP_X, EXAMPLE_LCD_GAP_Y);
|
||||
|
||||
ESP_GOTO_ON_ERROR(esp_lcd_panel_invert_color(lcd_panel, true), err, TAG, "设置反色失败");
|
||||
ESP_GOTO_ON_ERROR(esp_lcd_panel_invert_color(lcd_panel, EXAMPLE_LCD_INVERT_COLOR), err, TAG, "设置反色失败");
|
||||
ESP_GOTO_ON_ERROR(esp_lcd_panel_disp_on_off(lcd_panel, true), err, TAG, "打开显示失败");
|
||||
|
||||
ESP_RETURN_ON_ERROR(gpio_set_level(EXAMPLE_LCD_GPIO_BL, EXAMPLE_LCD_BL_ON_LEVEL), TAG, "背光引脚置位失败");
|
||||
ESP_LOGI(TAG, "背光已打开,电平=%d", EXAMPLE_LCD_BL_ON_LEVEL);
|
||||
if (EXAMPLE_LCD_GPIO_BL != GPIO_NUM_NC) {
|
||||
ESP_RETURN_ON_ERROR(gpio_set_level(EXAMPLE_LCD_GPIO_BL, EXAMPLE_LCD_BL_ON_LEVEL), TAG, "背光引脚置位失败");
|
||||
ESP_LOGI(TAG, "背光已打开,电平=%d", EXAMPLE_LCD_BL_ON_LEVEL);
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "颜色参数: order=%s invert=%d swap_bytes=%d",
|
||||
EXAMPLE_LCD_COLOR_ORDER_BGR ? "BGR" : "RGB",
|
||||
EXAMPLE_LCD_INVERT_COLOR,
|
||||
EXAMPLE_LCD_SWAP_BYTES);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -172,7 +183,7 @@ static esp_err_t app_lvgl_init(void)
|
||||
.flags = {
|
||||
.buff_dma = true,
|
||||
#if LVGL_VERSION_MAJOR >= 9
|
||||
.swap_bytes = false,
|
||||
.swap_bytes = EXAMPLE_LCD_SWAP_BYTES,
|
||||
#endif
|
||||
}};
|
||||
|
||||
@@ -218,7 +229,7 @@ static void app_main_display(void)
|
||||
*
|
||||
* 该函数是程序的入口点,负责初始化LCD硬件、LVGL库,并显示主界面
|
||||
*/
|
||||
esp_err_t lvgl_st7735s_set_center_text(const char *text)
|
||||
esp_err_t lvgl_st7789_set_center_text(const char *text)
|
||||
{
|
||||
ESP_RETURN_ON_FALSE(text != NULL, ESP_ERR_INVALID_ARG, TAG, "text is null");
|
||||
ESP_RETURN_ON_FALSE(s_center_label != NULL, ESP_ERR_INVALID_STATE, TAG, "label not ready");
|
||||
@@ -17,9 +17,9 @@
|
||||
// MQTT 密码
|
||||
#define MQTT_PASSWORD "YTGui8979HI"
|
||||
// 传感器数据发布主题
|
||||
#define MQTT_SENSOR_TOPIC "topic/sensor/esp32_BotanicalBuddy_001"
|
||||
#define MQTT_SENSOR_TOPIC "topic/sensor/esp32_BotanicalBuddy_002"
|
||||
// 控制指令订阅主题
|
||||
#define MQTT_CONTROL_TOPIC "topic/control/esp32_BotanicalBuddy_001"
|
||||
#define MQTT_CONTROL_TOPIC "topic/control/esp32_BotanicalBuddy_002"
|
||||
|
||||
|
||||
static const char *TAG = "mqtt_control"; // 日志标签
|
||||
|
||||
3
components/sntp_timp/CMakeLists.txt
Normal file
3
components/sntp_timp/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
idf_component_register(SRCS "sntp_timp.c"
|
||||
INCLUDE_DIRS "include"
|
||||
REQUIRES esp_timer esp_event esp_netif lwip)
|
||||
20
components/sntp_timp/include/sntp_timp.h
Normal file
20
components/sntp_timp/include/sntp_timp.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#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
|
||||
157
components/sntp_timp/sntp_timp.c
Normal file
157
components/sntp_timp/sntp_timp.c
Normal file
@@ -0,0 +1,157 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#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;
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -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 },
|
||||
};
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -22,101 +22,239 @@ lv_obj_t *tick_value_change_obj;
|
||||
// Screens
|
||||
//
|
||||
|
||||
void create_screen_temperature() {
|
||||
void create_screen_main() {
|
||||
lv_obj_t *obj = lv_obj_create(0);
|
||||
objects.temperature = obj;
|
||||
objects.main = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, 160, 80);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_size(obj, 240, 240);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xff000000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
{
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj0 = obj;
|
||||
lv_obj_set_pos(obj, 36, 0);
|
||||
lv_obj_set_pos(obj, 16, 53);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff000000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
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.obj1 = obj;
|
||||
lv_obj_set_pos(obj, 7, 30);
|
||||
lv_obj_set_pos(obj, 129, 55);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff00ff48), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_36, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_label_set_text(obj, "");
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_image_create(parent_obj);
|
||||
objects.obj2 = obj;
|
||||
lv_obj_set_pos(obj, 105, 23);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_image_set_src(obj, &img_temp);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_opa(obj, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
tick_screen_temperature();
|
||||
}
|
||||
|
||||
void tick_screen_temperature() {
|
||||
{
|
||||
const char *new_val = get_var_air_temperature();
|
||||
const char *cur_val = lv_label_get_text(objects.obj1);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj1;
|
||||
lv_label_set_text(objects.obj1, new_val);
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void create_screen_humidity() {
|
||||
lv_obj_t *obj = lv_obj_create(0);
|
||||
objects.humidity = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, 160, 80);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_opa(obj, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
{
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj3 = obj;
|
||||
lv_obj_set_pos(obj, 36, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff000000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
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.obj4 = obj;
|
||||
lv_obj_set_pos(obj, 7, 30);
|
||||
objects.obj2 = obj;
|
||||
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);
|
||||
lv_label_set_text(obj, "土壤湿度");
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj3 = obj;
|
||||
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);
|
||||
lv_label_set_text(obj, "光照强度");
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj4 = obj;
|
||||
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, &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, 127, 86);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
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_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_36, 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, 4, 163);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
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, 127, 163);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
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);
|
||||
objects.obj5 = obj;
|
||||
lv_obj_set_pos(obj, 105, 23);
|
||||
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, 78);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_image_set_src(obj, &img_humi);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_image_create(parent_obj);
|
||||
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, 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, 126);
|
||||
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_line_create(parent_obj);
|
||||
objects.obj9 = obj;
|
||||
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 },
|
||||
{ 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_line_create(parent_obj);
|
||||
objects.obj10 = obj;
|
||||
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, 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_humidity();
|
||||
tick_screen_main();
|
||||
}
|
||||
|
||||
void tick_screen_humidity() {
|
||||
void tick_screen_main() {
|
||||
{
|
||||
const char *new_val = get_var_air_humidity();
|
||||
const char *new_val = get_var_air_temperature();
|
||||
const char *cur_val = lv_label_get_text(objects.obj4);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj4;
|
||||
@@ -124,51 +262,26 @@ void tick_screen_humidity() {
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void create_screen_moisture() {
|
||||
lv_obj_t *obj = lv_obj_create(0);
|
||||
objects.moisture = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, 160, 80);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_opa(obj, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
{
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj6 = obj;
|
||||
lv_obj_set_pos(obj, 36, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff000000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, 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, 7, 30);
|
||||
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, &ui_font_source_han_sans_sc_medium_36, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_label_set_text(obj, "");
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_image_create(parent_obj);
|
||||
objects.obj8 = obj;
|
||||
lv_obj_set_pos(obj, 105, 23);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_image_set_src(obj, &img_mois);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
const char *new_val = get_var_air_humidity();
|
||||
const char *cur_val = lv_label_get_text(objects.obj5);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj5;
|
||||
lv_label_set_text(objects.obj5, new_val);
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
tick_screen_moisture();
|
||||
}
|
||||
|
||||
void tick_screen_moisture() {
|
||||
{
|
||||
const char *new_val = get_var_soil_moisture();
|
||||
const char *cur_val = lv_label_get_text(objects.obj6);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj6;
|
||||
lv_label_set_text(objects.obj6, new_val);
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
const char *new_val = get_var_light_intensity();
|
||||
const char *cur_val = lv_label_get_text(objects.obj7);
|
||||
if (strcmp(new_val, cur_val) != 0) {
|
||||
tick_value_change_obj = objects.obj7;
|
||||
@@ -176,55 +289,91 @@ void tick_screen_moisture() {
|
||||
tick_value_change_obj = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void create_screen_intensity() {
|
||||
lv_obj_t *obj = lv_obj_create(0);
|
||||
objects.intensity = obj;
|
||||
lv_obj_set_pos(obj, 0, 0);
|
||||
lv_obj_set_size(obj, 160, 80);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_opa(obj, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
{
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj9 = obj;
|
||||
lv_obj_set_pos(obj, 36, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff000000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_22, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_label_set_text(obj, "光照强度");
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_label_create(parent_obj);
|
||||
objects.obj10 = obj;
|
||||
lv_obj_set_pos(obj, 7, 30);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff13227a), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_source_han_sans_sc_medium_36, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_label_set_text(obj, "");
|
||||
}
|
||||
{
|
||||
lv_obj_t *obj = lv_image_create(parent_obj);
|
||||
objects.obj11 = obj;
|
||||
lv_obj_set_pos(obj, 105, 23);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_image_set_src(obj, &img_light);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
tick_screen_intensity();
|
||||
}
|
||||
|
||||
void tick_screen_intensity() {
|
||||
{
|
||||
const char *new_val = get_var_light_intensity();
|
||||
const char *cur_val = lv_label_get_text(objects.obj10);
|
||||
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.obj10;
|
||||
lv_label_set_text(objects.obj10, new_val);
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -232,10 +381,7 @@ void tick_screen_intensity() {
|
||||
|
||||
typedef void (*tick_screen_func_t)();
|
||||
tick_screen_func_t tick_screen_funcs[] = {
|
||||
tick_screen_temperature,
|
||||
tick_screen_humidity,
|
||||
tick_screen_moisture,
|
||||
tick_screen_intensity,
|
||||
tick_screen_main,
|
||||
};
|
||||
void tick_screen(int screen_index) {
|
||||
tick_screen_funcs[screen_index]();
|
||||
@@ -335,8 +481,5 @@ void create_screens() {
|
||||
|
||||
// Initialize screens
|
||||
// Create screens
|
||||
create_screen_temperature();
|
||||
create_screen_humidity();
|
||||
create_screen_moisture();
|
||||
create_screen_intensity();
|
||||
create_screen_main();
|
||||
}
|
||||
@@ -11,18 +11,12 @@ extern "C" {
|
||||
|
||||
enum ScreensEnum {
|
||||
_SCREEN_ID_FIRST = 1,
|
||||
SCREEN_ID_TEMPERATURE = 1,
|
||||
SCREEN_ID_HUMIDITY = 2,
|
||||
SCREEN_ID_MOISTURE = 3,
|
||||
SCREEN_ID_INTENSITY = 4,
|
||||
_SCREEN_ID_LAST = 4
|
||||
SCREEN_ID_MAIN = 1,
|
||||
_SCREEN_ID_LAST = 1
|
||||
};
|
||||
|
||||
typedef struct _objects_t {
|
||||
lv_obj_t *temperature;
|
||||
lv_obj_t *humidity;
|
||||
lv_obj_t *moisture;
|
||||
lv_obj_t *intensity;
|
||||
lv_obj_t *main;
|
||||
lv_obj_t *obj0;
|
||||
lv_obj_t *obj1;
|
||||
lv_obj_t *obj2;
|
||||
@@ -35,21 +29,21 @@ typedef struct _objects_t {
|
||||
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;
|
||||
|
||||
void create_screen_temperature();
|
||||
void tick_screen_temperature();
|
||||
|
||||
void create_screen_humidity();
|
||||
void tick_screen_humidity();
|
||||
|
||||
void create_screen_moisture();
|
||||
void tick_screen_moisture();
|
||||
|
||||
void create_screen_intensity();
|
||||
void tick_screen_intensity();
|
||||
void create_screen_main();
|
||||
void tick_screen_main();
|
||||
|
||||
void tick_screen_by_id(enum ScreensEnum screenId);
|
||||
void tick_screen(int screen_index);
|
||||
|
||||
@@ -23,7 +23,7 @@ void loadScreen(enum ScreensEnum screenId) {
|
||||
|
||||
void ui_init() {
|
||||
create_screens();
|
||||
loadScreen(SCREEN_ID_TEMPERATURE);
|
||||
loadScreen(SCREEN_ID_MAIN);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
79
components/ui/ui_image_mqtt_connected.c
Normal file
79
components/ui/ui_image_mqtt_connected.c
Normal file
@@ -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 <lvgl.h>
|
||||
#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,
|
||||
};
|
||||
79
components/ui/ui_image_mqtt_disconnected.c
Normal file
79
components/ui/ui_image_mqtt_disconnected.c
Normal file
@@ -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 <lvgl.h>
|
||||
#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,
|
||||
};
|
||||
79
components/ui/ui_image_wifi_connect.c
Normal file
79
components/ui/ui_image_wifi_connect.c
Normal file
@@ -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 <lvgl.h>
|
||||
#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,
|
||||
};
|
||||
79
components/ui/ui_image_wifi_disconnect.c
Normal file
79
components/ui/ui_image_wifi_disconnect.c
Normal file
@@ -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 <lvgl.h>
|
||||
#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,
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 =
|
||||
"<!doctype html><html><head><meta charset='utf-8'/>"
|
||||
@@ -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("配网模式", "常驻配网(上电自动开启且不会自动关闭)");
|
||||
|
||||
@@ -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_st7735s_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
|
||||
)
|
||||
|
||||
91
main/main.c
91
main/main.c
@@ -6,7 +6,7 @@
|
||||
#include "esp_check.h"
|
||||
#include "esp_log.h"
|
||||
#include "wifi-connect.h"
|
||||
#include "lvgl_st7735s_use.h"
|
||||
#include "lvgl_st7789_use.h"
|
||||
#include "i2c_master_messager.h"
|
||||
#include "io_device_control.h"
|
||||
#include "console_simple_init.h" // 提供 console_cmd_user_register 和 console_cmd_all_register
|
||||
@@ -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
|
||||
@@ -62,7 +63,7 @@
|
||||
// I2C 内部上拉使能
|
||||
#define BOTANY_I2C_INTERNAL_PULLUP CONFIG_I2C_MASTER_MESSAGER_ENABLE_INTERNAL_PULLUP
|
||||
// MQTT 告警主题
|
||||
#define BOTANY_MQTT_ALERT_TOPIC "topic/alert/esp32_iothome_001"
|
||||
#define BOTANY_MQTT_ALERT_TOPIC "topic/alert/esp32_iothome_002"
|
||||
// MQTT 遥测数据上报周期(毫秒)
|
||||
#define BOTANY_MQTT_TELEMETRY_PERIOD_MS 5000
|
||||
#define BOTANY_STATUS_WEB_PORT 8080
|
||||
@@ -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 控制命令处理函数
|
||||
*
|
||||
@@ -415,7 +441,7 @@ static void auto_control_update(bool soil_valid,
|
||||
/**
|
||||
* @brief UI 任务函数
|
||||
*
|
||||
* 负责定期切换显示页面(每3秒切换一次)。
|
||||
* 负责定期驱动 UI 刷新。
|
||||
*
|
||||
* @param arg 任务参数(未使用)
|
||||
*/
|
||||
@@ -423,29 +449,11 @@ static void ui_task(void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
|
||||
uint32_t elapsed_ms = 0;
|
||||
enum ScreensEnum current = SCREEN_ID_TEMPERATURE;
|
||||
const uint32_t switch_period_ms = 3000; // 每3秒切一次
|
||||
|
||||
for (;;)
|
||||
{
|
||||
lvgl_port_lock(0);
|
||||
ui_tick();
|
||||
|
||||
elapsed_ms += 20;
|
||||
if (elapsed_ms >= switch_period_ms) {
|
||||
elapsed_ms = 0;
|
||||
|
||||
// 下一个页面:1->2->3->4->1
|
||||
if (current >= _SCREEN_ID_LAST) {
|
||||
current = _SCREEN_ID_FIRST;
|
||||
} else {
|
||||
current = (enum ScreensEnum)(current + 1);
|
||||
}
|
||||
|
||||
loadScreen(current);
|
||||
}
|
||||
|
||||
lvgl_port_unlock();
|
||||
vTaskDelay(pdMS_TO_TICKS(20));
|
||||
}
|
||||
@@ -458,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;
|
||||
|
||||
@@ -480,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 主函数
|
||||
*
|
||||
@@ -532,7 +556,7 @@ void app_main(void)
|
||||
{
|
||||
ESP_LOGE(TAG, "I2C 传感器管理启动失败: %s", esp_err_to_name(ret));
|
||||
ESP_LOGW(TAG, "请检查 I2C 引脚/上拉电阻/端口占用情况,系统将继续运行但不采集传感器");
|
||||
ESP_ERROR_CHECK(lvgl_st7735s_set_center_text("I2C init failed"));
|
||||
ESP_ERROR_CHECK(lvgl_st7789_set_center_text("I2C init failed"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -565,22 +589,34 @@ 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 客户端
|
||||
|
||||
ESP_ERROR_CHECK(console_cmd_init());
|
||||
ESP_ERROR_CHECK(console_user_cmds_register());
|
||||
ESP_ERROR_CHECK(console_cmd_all_register()); // 可选:自动注册插件命令
|
||||
ESP_ERROR_CHECK(console_cmd_start());
|
||||
// ESP_ERROR_CHECK(console_cmd_init());
|
||||
// ESP_ERROR_CHECK(console_user_cmds_register());
|
||||
// ESP_ERROR_CHECK(console_cmd_all_register()); // 可选:自动注册插件命令
|
||||
// ESP_ERROR_CHECK(console_cmd_start());
|
||||
|
||||
auto_ctrl_thresholds_init_defaults();
|
||||
auto_alerts_init();
|
||||
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,
|
||||
@@ -594,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;
|
||||
|
||||
Reference in New Issue
Block a user