From d5777a0e26f94314af6408c1dff8d34abf8ff9fc Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期一, 11 四月 2022 17:49:40 +0800 Subject: [PATCH] 去掉基站修改标签参数 --- 源码/核心板/Src/main.c | 35 ++++------------------------------- 1 files changed, 4 insertions(+), 31 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" index 937aa78..c2f7062 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" @@ -2,6 +2,7 @@ #include "Rcc_Nvic_Systick.h" #include "Usart.h" #include "Spi.h" +#include "Flash.h" #include "led.h" #include "beep.h" #include "dw_driver.h" @@ -115,7 +116,8 @@ g_com_map[COM_INTERVAL]=100; } JDQ_time = g_com_map[WAR_JDQ_TIME]*10; - g_com_map[VERSION] = 0x0135; + g_com_map[VERSION] = 0x0136; + FLASH_Read(FLASH_HARDWARE_FLAG, (uint8_t*)&g_com_map[HARDWAREFLAG_INDEX], 16); dist_threshold = (g_com_map[SPEEDFILTER_THRES]*10)/(1000/g_com_map[COM_INTERVAL]); ComMapCheck(); g_com_map[SW_TYPE] = SW_FANGZHUANG; @@ -237,36 +239,7 @@ anc_report_num=0; } #endif - if(g_com_map[CNT_UPDATE]==1) - { - uint32_t result = 0; - u16 tmp = 0xAAAA; - __disable_irq(); - result = FLASH_Prepare(0x8004A38, 2); - if(result) - result = FLASH_Write(0x8004A38, (const uint8_t*)&tmp, 2); - __enable_irq(); - printf("进入升级模式\r\n"); - g_com_map[CNT_UPDATE]=0; - save_com_map_to_flash(); - delay_ms(100); - // STMFLASH_Write_NoCheck(0x8004A38,0xAAAA); - // Delay_ms(100); - SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader - } - if(g_com_map[CNT_REBOOT]==1) - { - FactorySettings(); - - 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 -- Gitblit v1.9.3