| | |
| | | Error_Handler(); |
| | | } |
| | | } |
| | | u8 active_flag=0; |
| | | uint16_t hardware_version,hardware_pici,hardware_type; |
| | | u16 current_time; |
| | | uint8_t state5v; |
| | |
| | | // LED_TB_OFF; |
| | | //}else{ |
| | | // LED_TR_OFF; |
| | | // while(1) |
| | | // { |
| | | // current_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | // if(current_time-beepcount>3||beepcount>current_time) |
| | | // { |
| | | // beepcount = current_time; |
| | | // LED_BLINK(GPIOA, GPIO_PIN_11); |
| | | // } |
| | | //} |
| | | if(active_flag) |
| | | { |
| | | current_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | if(current_time-beepcount>3||beepcount>current_time) |
| | | { |
| | | beepcount = current_time; |
| | | LED_BLINK(GPIOA, GPIO_PIN_11); |
| | | } |
| | | } |
| | | |
| | | |
| | | //motor_state=2; |
| | |
| | | if(g_com_map[POWER]<0) |
| | | {g_com_map[POWER]=0;} |
| | | } |
| | | u8 active_flag=0; |
| | | |
| | | void Program_Init(void) |
| | | { float temp; |
| | | uint16_t temp2; |
| | |
| | | // g_com_map[IMU_ENABLE]=0; |
| | | // g_com_map[COM_INTERVAL]=1000; |
| | | active_flag = g_com_map[ACTIVE_INDEX]; |
| | | g_com_map[COM_INTERVAL]=50; |
| | | if(active_flag==0) |
| | | { |
| | | g_com_map[COM_INTERVAL]=1000; |
| | | g_com_map[IMU_ENABLE]=1; |
| | | g_com_map[NOMOVESLEEP_TIME]=10; |
| | | g_com_map[NOMOVESLEEP_TIME]=3; |
| | | g_com_map[MOTOR_ENABLE]=0; |
| | | } |
| | | //g_com_map[HEIGHTOFFEST_INDEX]=g_com_map[MAX_REPORT_ANC_NUM]; |
| | |
| | | { |
| | | Error_Handler(); |
| | | } |
| | | |
| | | LED_BLINK(GPIOA, GPIO_PIN_11); |
| | | // HAL_Delay(2000); |
| | | // mcu_sleep(); |
| | | //LED0_BLINK; |