From 4f0725852fbce5f98a7ec016eacb63e3e8615cd6 Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期五, 13 九月 2024 14:25:08 +0800 Subject: [PATCH] 1.49 --- Src/main.c | 53 +++++++++++++++++++++++------------------------------ 1 files changed, 23 insertions(+), 30 deletions(-) diff --git a/Src/main.c b/Src/main.c index 6f4507c..1f09eab 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: @@ -276,9 +276,9 @@ 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; @@ -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)|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]; @@ -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; @@ -455,15 +456,7 @@ // 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) -- Gitblit v1.9.3