| | |
| | | extern uint8_t chongman_flag; |
| | | uint8_t jinru_parsegga_flag; |
| | | uint8_t input_5v_flag; |
| | | uint8_t num; |
| | | void Bat_Percent_Poll() |
| | | { |
| | | bat_time++; |
| | |
| | | SystemClock_Config(); |
| | | Gps_Chongqi_Poll(); |
| | | Powerled_Poll(); |
| | | Set4LEDColor(powerled,loraled,gpsled,uwbled); |
| | | if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)&&chongman_flag==0) |
| | | { |
| | | num++; |
| | | if(num>2) |
| | | { |
| | | num=0; |
| | | powerled=LEDOFF; |
| | | loraled=LEDOFF; |
| | | gpsled=LEDOFF; |
| | | uwbled=LEDOFF; |
| | | Set4LEDColor_Off(); |
| | | } |
| | | else |
| | | { |
| | | Set4LEDColor(powerled,loraled,gpsled,uwbled); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Set4LEDColor(powerled,loraled,gpsled,uwbled); |
| | | } |
| | | Fangchai_Panduan_Poll(); |
| | | Yundong_Panduan_Poll(); |
| | | heart_time++; |
| | | nomove_count++; |
| | | Sleep_Panduan_Poll(); |
| | | Bat_Percent_Poll(); |
| | | if(!chongman_flag) |
| | | // if(!chongman_flag) |
| | | // { |
| | | // powerled=LEDOFF; |
| | | // loraled=LEDOFF; |
| | | // gpsled=LEDOFF; |
| | | // uwbled=LEDOFF; |
| | | // Set4LEDColor_Off(); |
| | | // } |
| | | if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)&&chongman_flag==0) |
| | | { |
| | | powerled=LEDOFF; |
| | | loraled=LEDOFF; |
| | | gpsled=LEDOFF; |
| | | uwbled=LEDOFF; |
| | | Set4LEDColor_Off(); |
| | | } |
| | | else |
| | | { |
| | | if(chongman_flag) |
| | | {} |
| | | else |
| | | { |
| | | powerled=LEDOFF; |
| | | loraled=LEDOFF; |
| | | gpsled=LEDOFF; |
| | | uwbled=LEDOFF; |
| | | Set4LEDColor_Off(); |
| | | } |
| | | } |
| | | HAL_IWDG_Refresh(&hiwdg); |
| | | } |