update 解决相关bug

This commit is contained in:
2026-04-02 18:00:37 +08:00
parent 2f1319a378
commit 4c4cfa76b4
16 changed files with 423 additions and 186 deletions
+7 -4
View File
@@ -57,6 +57,7 @@ app_timer_class_t app_timer_task[] =
******************************************/
void app_init(void)
{
// Wdg.Init();
/*flash*/
w25q32.init();
@@ -72,6 +73,8 @@ void app_init(void)
/*网口*/
W5500.Init();
/*屏幕通讯*/
tjc_hmi.init();
@@ -89,7 +92,6 @@ void app_init(void)
relay.init();
buzzer.init();
led.init();
leakage.init();
/*com口绑定*/
app_com.init();
@@ -97,8 +99,7 @@ void app_init(void)
/*分时复用,时间片轮询*/
app_timer.init(APP_TIMER_TASK_NUM,app_timer_task);
//Wdg.Init();
}
/******************************************
@@ -112,7 +113,7 @@ void app_task(void)
{
app_timer.task();
task_idle();
W5500.Task();
// W5500.Task();
}
/*空闲执行的函数*/
void task_idle(void)
@@ -123,6 +124,7 @@ void task_idle(void)
com_uart4.rx_task(&com_uart4);
com_uart6.rx_task(&com_uart6);
W5500.Task();
// Wdg.Feed();
}
void task_10ms(void)
@@ -160,6 +162,7 @@ void task_1s(void)
DS1302.Task();
buzzer.task();
relay.task();
W5500.Monitor_task();
}
void task_2s(void)
+1 -1
View File
@@ -163,7 +163,7 @@ void app_leakage_task(void)
}
/* 检查设备是否屏蔽 */
if(p_leakage->sub_device_data[sub_device_index].flash_data.shield != UNBLOCKED)
if(p_leakage->sub_device_data[sub_device_index].shield != UNBLOCKED)
{
continue;
}
+10 -2
View File
@@ -27,8 +27,7 @@ typedef struct
{
u8 state; /*状态 使能 非使能*/
u8 com; /*端口*/
u8 baudrate; /*波特率*/
u8 shield; /*设备屏蔽状态*/
u8 baudrate; /*波特率*/
u8 modbus_id; /*modbus id*/
u8 device_name[APP_LEAKAGE_STRING_NANE_LEN]; /*设备名*/
u8 region_name[APP_LEAKAGE_STRING_NANE_LEN]; /*区域名*/
@@ -45,6 +44,7 @@ typedef struct
}ch_data[APP_LEAKAGE_SUB_DEVICE_CH_NUM]; /*通道数据*/
u8 heartbeat; /*心跳包,0-59循环*/
u8 test_mode; /*测试模式,0=正常,1-4=测试对应通道*/
u8 shield; /*设备屏蔽状态*/
}app_leakage_sub_device_class_t;
@@ -59,6 +59,14 @@ typedef struct
u8 sub_device_index[APP_LEAKAGE_SUB_DEVICE_NUM]; /*设备的索引*/
}app_leakage_region_data_class_t;
/* 网络配置结构体 */
typedef struct {
u8 ip[4];
u8 mask[4];
u8 gateway[4];
u16 port;
}network_config_t;
/* 历史报警记录结构 */
typedef struct
{