From 4d7183688398cd3e6fa9c0b7f74d4f47b4fab37e Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期三, 20 八月 2025 15:25:04 +0800 Subject: [PATCH] V1.53 随机时间片跳 --- Src/main.c | 39 ++++++++++++++++++++------------------- 1 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Src/main.c b/Src/main.c index a83bbd0..80a0f08 100644 --- a/Src/main.c +++ b/Src/main.c @@ -226,21 +226,21 @@ // 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 @@ -256,9 +256,9 @@ 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: @@ -289,7 +289,7 @@ 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)|39; + g_com_map[VERSION] = (1<<8)|53; active_flag = g_com_map[ACTIVE_INDEX]; module_power = g_com_map[POWER]; imu_enable=g_com_map[IMU_ENABLE]; @@ -306,6 +306,7 @@ 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; -- Gitblit v1.9.3