| | |
| | | * 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)) |
| | |
| | | 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)//按钮关机 |
| | | // { |
| | |
| | | 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"); |
| | | } |
| | | } |
| | | |
| | |
| | | #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(); |
| | | } |
| | | |
| | | } |