| | |
| | | // Delay_ms(100); |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | } |
| | | if(g_com_map[CNT_REBOOT]==1) |
| | | { |
| | | g_com_map[CNT_REBOOT]=0; |
| | | g_com_map[MAP_SIGN_INDEX]=0; |
| | | save_com_map_to_flash(); |
| | | delay_ms(100); |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | } |
| | | if(g_com_map[CNT_RESTART]==1) |
| | | { |
| | | g_com_map[CNT_RESTART]=0; |
| | | save_com_map_to_flash(); |
| | | delay_ms(100); |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | } |
| | | // if(g_com_map[CNT_REBOOT]==1) |
| | | // { |
| | | // g_com_map[CNT_REBOOT]=0; |
| | | // g_com_map[MAP_SIGN_INDEX]=0; |
| | | // save_com_map_to_flash(); |
| | | // delay_ms(100); |
| | | // SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | // } |
| | | // if(g_com_map[CNT_RESTART]==1) |
| | | // { |
| | | // g_com_map[CNT_RESTART]=0; |
| | | // save_com_map_to_flash(); |
| | | // delay_ms(100); |
| | | // SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | // } |
| | | if(g_com_map[MAP_SIGN_INDEX]!=0x55AA||g_com_map[COM_INTERVAL]==0) |
| | | { |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | |
| | | void HardWareTypeDiffConfig(void) |
| | | { |
| | | GPIO_InitTypeDef GPIO_InitStruct = {0}; |
| | | //hardware_type=2; |
| | | if(hardware_type == 0) |
| | | hardware_type = 1; |
| | | hardware_type=g_com_map[ALARM_DISTANCE1]+1; |
| | | // if(hardware_type == 0) |
| | | // hardware_type = 1; |
| | | switch(hardware_type) |
| | | { |
| | | case 1: |
| | |
| | | break; |
| | | } |
| | | } |
| | | uint16_t bigslot_num; |
| | | uint16_t bigslot_num,nomovesleeptime; |
| | | int16_t g_commap_antdelay; |
| | | u8 active_flag,nomovesleeptime; |
| | | u8 active_flag; |
| | | void Program_Init(void) |
| | | { float temp; |
| | | uint16_t temp2; |
| | |
| | | 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)|34; |
| | | g_com_map[VERSION] = (1<<8)|49; |
| | | active_flag = g_com_map[ACTIVE_INDEX]; |
| | | module_power = g_com_map[POWER]; |
| | | imu_enable=g_com_map[IMU_ENABLE]; |
| | |
| | | bigslot_num = TOTAL_SLOTNUM/tag_frequency; |
| | | total_slotnum = 1000/g_com_map[COM_INTERVAL]; |
| | | nomovesleeptime = g_com_map[NOMOVESLEEP_TIME]; |
| | | active_flag = 1; |
| | | if(active_flag==0) |
| | | { |
| | | imu_enable=1; |
| | |
| | | // LED_TR_BLINK;s |
| | | |
| | | bat_percent=Get_Battary(); |
| | | if(bat_percent>15) |
| | | { LED_TB_ON; |
| | | Tag_App(); |
| | | LED_TB_OFF; |
| | | } else { |
| | | LED_TR_ON; |
| | | Tag_App(); |
| | | LED_TR_OFF; |
| | | } |
| | | Tag_App(); |
| | | //LED0_BLINK; |
| | | IdleTask(); |
| | | if(waitusart_timer>0) |