| | |
| | | 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] = (2<<8)|60; |
| | | g_com_map[VERSION] = (2<<8)|61; |
| | | |
| | | // g_com_map[DEV_ID]=0x7; |
| | | #ifdef DEBUG_MODE |
| | |
| | | /*Enter the Standby mode*/ |
| | | HAL_PWR_EnterSTANDBYMode(); |
| | | } |
| | | extern u16 tagslotpos; |
| | | extern uint8_t tx_near_msg[80],stationary_flag,gotosleep_flag,current_sync_sec,tagpoll_sync_sec; |
| | | |
| | | extern u16 tagslotpos,current_slotpos; |
| | | extern uint8_t tx_near_msg[80],stationary_flag,gotosleep_flag,current_sync_sec,tagpoll_sync_sec,flag_tagnewpos; |
| | | float key_keeptime; |
| | | extern float motor_ontime; |
| | | extern uint16_t rec_tagperiod; |
| | | void GetRandomPos(void) |
| | | { |
| | | current_slotpos = HAL_LPTIM_ReadCounter(&hlptim1)%max_slotpos; //如果丢失连接超过5次就随机换个时间片 |
| | | tagpoll_sync_sec = current_slotpos/200; |
| | | tagslotpos = current_slotpos%200; |
| | | flag_tagnewpos = 0; |
| | | } |
| | | void HAL_LPTIM_CompareMatchCallback(LPTIM_HandleTypeDef *hlptim) |
| | | { |
| | | static uint8_t i=0; |
| | |
| | | |
| | | // current_slotnum++; |
| | | // SetNextPollTime(tagslotpos); |
| | | |
| | | if(current_slotpos>=max_slotpos) |
| | | { |
| | | GetRandomPos(); |
| | | } |
| | | if(current_sync_sec==tagpoll_sync_sec) |
| | | { |
| | | g_start_send_flag=1; |