From fa86ebd985aaf06c2257a41f04e131a74a3c79bc Mon Sep 17 00:00:00 2001 From: chen <15335560115@163.com> Date: 星期五, 10 一月 2025 16:57:07 +0800 Subject: [PATCH] 稳定7个标签上线不掉线版本 --- keil/include/main/main.c | 66 ++++++++++++++++---------------- 1 files changed, 33 insertions(+), 33 deletions(-) diff --git a/keil/include/main/main.c b/keil/include/main/main.c index bec7732..d19347f 100644 --- a/keil/include/main/main.c +++ b/keil/include/main/main.c @@ -295,7 +295,7 @@ void IMUTask(void) { if(nomove_count>g_com_map[NOMOVESLEEP_TIME]&&g_com_map[IMU_ENABLE]==1) - {power_wakeup_enable((enum POWER_WAKEUP_SOURCE_T)ACCLERATE_DETECT_Pin, POWER_WAKEUP_LEVEL_HIGH); + {//power_wakeup_enable((enum POWER_WAKEUP_SOURCE_T)ACCLERATE_DETECT_Pin, POWER_WAKEUP_LEVEL_HIGH); mcu_deep_sleep(); } } @@ -321,24 +321,24 @@ } void PowerTask(void) { -// if(read_powerkey_input_pca()) -// { -// if(HIDO_TimerGetTick() - keystarttime>2) + if(read_powerkey_input_pca()) + { + if(HIDO_TimerGetTick() - keystarttime>2) + { + keystarttime = HIDO_TimerGetTick(); + PCA9555_Set_One_Value_Output(PWR_ENABLE,0);//低电平关闭 + PCA9555_Set_One_Value_Output(GPS_LED,0);//输出低电平关闭LED + } +// if(HIDO_TimerGetTick() - keystarttime2>10) // { -// keystarttime = HIDO_TimerGetTick(); -// PCA9555_Set_One_Value_Output(PWR_ENABLE,0);//低电平关闭 -// PCA9555_Set_One_Value_Output(GPS_LED,0);//输出低电平关闭LED +// +// g_com_map[CNT_RESTART] = 1; // } -//// if(HIDO_TimerGetTick() - keystarttime2>10) -//// { -//// -//// g_com_map[CNT_RESTART] = 1; -//// } -// }else -// { -// keystarttime = HIDO_TimerGetTick(); -// keystarttime2 = HIDO_TimerGetTick(); -// } + }else + { + keystarttime = HIDO_TimerGetTick(); + keystarttime2 = HIDO_TimerGetTick(); + } } void MinuteTask(void) { @@ -366,23 +366,23 @@ // //UWB状态检测 //if(!power_low_flag)//低供电下不需要检测重连 // { -// if(IfTCPConnected()) -// { -// TCP_reconnect_timer =0; -// flag_TCP_reconnectting = 0; -// } else { -// if(TCP_reconnect_timer<30)//如果TCP没有连接,每隔10分钟尝试连接30秒 -// { -// flag_TCP_reconnectting = 1; -// } else { -// flag_TCP_reconnectting = 0; -// } -// if(TCP_reconnect_timer++>600) -// { -// TCP_reconnect_timer = 0; -// } + if(IfTCPConnected()) + { + TCP_reconnect_timer =0; + flag_TCP_reconnectting = 0; + } else { + if(TCP_reconnect_timer<30)//如果TCP没有连接,每隔10分钟尝试连接30秒 + { + flag_TCP_reconnectting = 1; + } else { + flag_TCP_reconnectting = 0; + } + if(TCP_reconnect_timer++>600) + { + TCP_reconnect_timer = 0; + } -// } + } // } HIDO_TimerTick(); if(nomove_count<=g_com_map[NOMOVESLEEP_TIME])//防止溢出 -- Gitblit v1.9.3