| | |
| | | { |
| | | case 1: |
| | | |
| | | HAL_GPIO_WritePin(GPIOB, MOTOR_Pin, GPIO_PIN_SET); |
| | | HAL_GPIO_WritePin(GPIOB, MOTOR_Pin, GPIO_PIN_SET); |
| | | GPIO_InitStruct.Pin = MOTOR_Pin; |
| | | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
| | | GPIO_InitStruct.Pull = GPIO_NOPULL; |
| | |
| | | break; |
| | | } |
| | | } |
| | | int16_t g_commap_antdelay; |
| | | u8 active_flag,nomovesleeptime; |
| | | void Program_Init(void) |
| | | { float temp; |
| | |
| | | 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)|29; |
| | | g_com_map[VERSION] = (1<<8)|31; |
| | | active_flag = g_com_map[ACTIVE_INDEX]; |
| | | module_power = g_com_map[POWER]; |
| | | module_power = g_com_map[POWER]; |
| | | imu_enable=g_com_map[IMU_ENABLE]; |
| | | motor_enable=g_com_map[MOTOR_ENABLE]; |
| | | |
| | |
| | | {module_power=67;} |
| | | if(module_power<0) |
| | | {module_power=0;} |
| | | |
| | | if(g_com_map[ANT_LENGTH]>10000) |
| | | { |
| | | g_com_map[ANT_LENGTH] = 0; |
| | | } |
| | | g_commap_antdelay = -g_com_map[DIST_OFFSET]; |
| | | current_slotnum=1; |
| | | current_time=GetLPTime(); |
| | | if (HAL_LPTIM_TimeOut_Start_IT(&hlptim1, LPTIMER_1S_COUNT, slot_startcount) != HAL_OK) //system time is 1010ms 1 puls=30.518us |
| | |
| | | /* USER CODE BEGIN 2 */ |
| | | LED_LG_ON; |
| | | Program_Init(); |
| | | LIS3DH_Data_Init(); |
| | | Accelerometer_Init(); |
| | | Dw1000_Init(); |
| | | Dw1000_App_Init(); |
| | | HardWareTypeDiffConfig(); |