| | |
| | | uint16_t hardware_version,hardware_pici,hardware_type; |
| | | u16 current_time; |
| | | uint8_t state5v; |
| | | uint8_t uart_time; |
| | | uint8_t uart_init_flag; |
| | | void IdleTask(void) |
| | | { |
| | | |
| | | if(uart_init_flag) |
| | | { |
| | | UsartInit(); |
| | | uart_init_flag=0; |
| | | } |
| | | UART_CheckReceive(); |
| | | UART_CheckSend(); |
| | | |
| | |
| | | // LED_TR_OFF; |
| | | current_time=GetLPTime(); |
| | | //motor_state=2; |
| | | |
| | | |
| | | // bat_percent=Get_Battary(); |
| | | // if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)) |
| | | // { |
| | |
| | | hardware_pici= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2); |
| | | hardware_type= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4); |
| | | //deca_sleep(1000); |
| | | g_com_map[VERSION] = (1<<8)|1; |
| | | g_com_map[VERSION] = (1<<8)|2; |
| | | |
| | | // g_com_map[DEV_ID]=0x0011; |
| | | #ifdef DEBUG_MODE |
| | |
| | | extern uint8_t tx_near_msg[80],stationary_flag,gotosleep_flag; |
| | | float key_keeptime; |
| | | extern float motor_ontime,button_delay; |
| | | uint8_t uart_time; |
| | | uint8_t uart_init_flag; |
| | | void HAL_LPTIM_CompareMatchCallback(LPTIM_HandleTypeDef *hlptim) |
| | | { |
| | | static uint8_t i=0; |
| | |
| | | if(button_delay<1) |
| | | button_delay+=1/(float)tag_frequency; |
| | | nomove_count+=1/(float)tag_frequency; |
| | | uart_time++; |
| | | if(uart_time>60) |
| | | { |
| | | uart_init_flag=1; |
| | | uart_time=0; |
| | | } |
| | | // if(motor_keeptime>0) |
| | | // { |
| | | // motor_keeptime-=1/(float)tag_frequency; |