| | |
| | | // l_bIsVibration = HIDO_TRUE; |
| | | nomove_time=0; |
| | | } |
| | | if(GPIO_Pin == GPIO_PIN_9) |
| | | { |
| | | HAL_ResumeTick(); |
| | | // if(GPIO_Pin == GPIO_PIN_9)//按钮关机 |
| | | // { |
| | | // HAL_ResumeTick(); |
| | | |
| | | SystemClock_Config(); |
| | | MX_Init(); |
| | | Uart_ReInit(UART_ID_DBG); |
| | | Uart_ReInit(UART_ID_LORA); |
| | | Uart_ReInit(UART_ID_GPS); |
| | | // SystemClock_Config(); |
| | | // MX_Init(); |
| | | // Uart_ReInit(UART_ID_DBG); |
| | | // Uart_ReInit(UART_ID_LORA); |
| | | // Uart_ReInit(UART_ID_GPS); |
| | | // |
| | | |
| | | |
| | | |
| | | PowerDownDetect(); |
| | | } |
| | | // |
| | | // PowerDownDetect(); |
| | | // } |
| | | |
| | | } |
| | | extern uint8_t lora_rxbuf[256]; |
| | | extern uint8_t lora_rxbufnum; |
| | | extern void Set4LEDColor_Off(void); |
| | | uint8_t lora_sendfinalbag_num; |
| | | void Lora_Sendfinalbag_Poll() |
| | |
| | | if(lp_time-lora_sendfinalbag_time>10&&lora_sendfinalbag_flag) |
| | | { |
| | | lora_sendfinal_rx_bag_flag=1; |
| | | Lora_SendData((HIDO_UINT8 *)GPS_final_data,GPS_final_changdu); |
| | | Lora_SendData((HIDO_UINT8 *)GPS_final_data,GPS_final_changdu); //发送数据 |
| | | memset(&lora_rxbuf,0,sizeof(lora_rxbuf));//发一次清一次rx的缓存 |
| | | lora_rxbufnum=0; |
| | | lora_sendfinalbag_time=lp_time; |
| | | lora_sendfinalbag_num=lora_sendfinalbag_num+1; |
| | | loraled=BLUE; |
| | |
| | | HAL_Delay(100); |
| | | loraled=LEDOFF; |
| | | Set4LEDColor(powerled,loraled,gpsled,uwbled); |
| | | if(lora_sendfinalbag_num>4) |
| | | if(lora_sendfinalbag_num>30) |
| | | { |
| | | lora_sendfinal_rx_bag_flag=0; |
| | | lora_sendfinalbag_flag=0; |
| | |
| | | if(((Lora_IsIdle() == HIDO_TRUE)/*为了防止lora初始化的时候进入休眠*/ |
| | | && (GPS_IsIdle() == HIDO_TRUE)/*防止gps工作时进入休眠*/ |
| | | &&(lora_sendfinal_rx_bag_flag==0)//防止lora在2s等待接收的时候进入休眠 |
| | | && (IsTypecCActive() == HIDO_FALSE)) /*5v输入检测时不休眠*/||nomove_flag==1/*静止1小时立刻休眠。*/) |
| | | && (IsTypecCActive() == HIDO_FALSE)&&(fangchai_flag==0)) /*5v输入检测时不休眠*/||nomove_flag==1/*静止1小时立刻休眠。*/) |
| | | { |
| | | ////// if(Lora_IsIdle() == HIDO_TRUE) |
| | | Power_Sleep(); |