From 37e61b5bf9aba18b6d0a5a4892494f0016c6e9c6 Mon Sep 17 00:00:00 2001 From: WXK <287788329@qq.com> Date: 星期一, 18 十二月 2023 16:11:14 +0800 Subject: [PATCH] 1 --- APL/APL.c | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 42 insertions(+), 12 deletions(-) diff --git a/APL/APL.c b/APL/APL.c index 9c6fd3e..b219aff 100644 --- a/APL/APL.c +++ b/APL/APL.c @@ -168,6 +168,15 @@ * Author : 杜键 * Modified Date: : 2018年5月8日 *******************************************************************************/ +HIDO_BOOL TypecCActive(void) +{ + if(GPIO_IS_SET(&l_stTypeCPIN)) + { + return HIDO_TRUE; + } + + return HIDO_FALSE; +} static HIDO_BOOL IsTypecCActive(void) { if(GPIO_IS_SET(&l_stTypeCPIN)) @@ -190,12 +199,15 @@ extern uint32_t nomove_time; extern void MX_Init(void); extern void SystemClock_Config(void); +uint8_t jiasudu; void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if(GPIO_Pin == GPIO_PIN_5) { // l_bIsVibration = HIDO_TRUE; nomove_time=0; +// HIDO_Debug("有效测距%d\r\n",youxiao_ceju); + jiasudu=1; } // if(GPIO_Pin == GPIO_PIN_9)//按钮关机 // { @@ -220,26 +232,26 @@ void Lora_Sendfinalbag_Poll() { // Lora_SendData((HIDO_UINT8 *)GPS_final_data,GPS_final_changdu); -if(lp_time-lora_sendfinalbag_time>10&&lora_sendfinalbag_flag) +if(lp_time-lora_sendfinalbag_time>6) { lora_sendfinal_rx_bag_flag=1; - Lora_SendData((HIDO_UINT8 *)GPS_final_data,GPS_final_changdu); //发送数据 - memset(&lora_rxbuf,0,sizeof(lora_rxbuf));//发一次清一次rx的缓存 - lora_rxbufnum=0; + Lora_SendData((HIDO_UINT8 *)GPS_final_data,11); //发送数据 +// memset(&lora_rxbuf,0,sizeof(lora_rxbuf));//发一次清一次rx的缓存 +// lora_rxbufnum=0; lora_sendfinalbag_time=lp_time; - lora_sendfinalbag_num=lora_sendfinalbag_num+1; +// lora_sendfinalbag_num=lora_sendfinalbag_num+1; loraled=BLUE; Set4LEDColor(powerled,loraled,gpsled,uwbled); HAL_Delay(100); loraled=LEDOFF; Set4LEDColor(powerled,loraled,gpsled,uwbled); - if(lora_sendfinalbag_num>4) - { - lora_sendfinal_rx_bag_flag=0; - lora_sendfinalbag_flag=0; - lora_sendfinalbag_num=0; - } - HIDO_Debug("lora bufa\r\n"); +// if(lora_sendfinalbag_num>4) +// { +// lora_sendfinal_rx_bag_flag=0; +// lora_sendfinalbag_flag=0; +// lora_sendfinalbag_num=0; +// } +// HIDO_Debug("lora fa\r\n"); } } @@ -451,3 +463,21 @@ #endif return HIDO_OK; } +HIDO_INT32 ceshi(void) +{ + HIDO_TimerPoll(); + IdleTask(); + GPS_Poll();//gps接收函数 + Lora_Poll();//lora接收函数 + Lora_Sendfinalbag_Poll(); + + if(IsDisassemblyAlarm()) + { + Beep_Off(); + } + else + { + Beep_On(); + } + +} \ No newline at end of file -- Gitblit v1.9.3