From de3d43245fd148de72fa7a70d2f7b95d02590a7e Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期三, 26 七月 2023 18:01:39 +0800 Subject: [PATCH] V2.15 回复出厂逻辑,解决恢复出厂就死机的BUG --- Src/main.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Src/main.c b/Src/main.c index 933c87a..3e6b6da 100644 --- a/Src/main.c +++ b/Src/main.c @@ -227,10 +227,7 @@ } 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); + ReturnFactory(); SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader } if(g_com_map[CNT_RESTART]==1) @@ -308,7 +305,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)|32; + g_com_map[VERSION] = (1<<8)|35; active_flag = g_com_map[ACTIVE_INDEX]; module_power = g_com_map[POWER]; imu_enable=g_com_map[IMU_ENABLE]; @@ -521,7 +518,7 @@ /** Configure LSE Drive Capability */ HAL_PWR_EnableBkUpAccess(); - __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); + __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_HIGH); /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSE; -- Gitblit v1.9.3