From d6d0f9b94b8488508f0c8eab0602d9dcfec31505 Mon Sep 17 00:00:00 2001 From: WXK <287788329@qq.com> Date: 星期三, 10 四月 2024 10:59:40 +0800 Subject: [PATCH] V1.6,加入心跳包上传sim卡号,心跳包上传防拆跟充电标志。 --- Core/Src/main.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index d051ae7..8fb980a 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -803,6 +803,7 @@ uint8_t air780_state; extern uint8_t chongman_flag; uint8_t jinru_parsegga_flag; +uint8_t input_5v_flag; void Bat_Percent_Poll() { bat_time++; @@ -815,7 +816,7 @@ void Powerled_Poll() { if(!HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)) - { + {input_5v_flag=0; if(bat_percent>DIANLIANG) { powerled = RED; @@ -825,9 +826,17 @@ powerled = RED; } } + else + { + input_5v_flag=1; + } } void Fangchai_Panduan_Poll() { + if(HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_1)) // 设备被拆卸 + { fangchai_flag=1;} + else + { fangchai_flag=0;} if(fangchai_flag) { fangchai_time++; -- Gitblit v1.9.3