From 61cbf077fdb7b00a961e4edb6bd9c4065bd3efae Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期三, 20 一月 2021 11:06:05 +0800 Subject: [PATCH] V1.38 1恢复出厂模式设置正常 --- 源码/核心板/Src/main.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 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 953c548..84bb743 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" @@ -44,6 +44,7 @@ checksum = Checksum_u16(&hbsend[2],12); memcpy(&hbsend[14],&checksum,2); } +uint16_t vel_factor,pos_factor; u16 tyncpoll_time; u16 slottime,max_slotpos; extern u8 module_power; @@ -71,13 +72,17 @@ { g_com_map[COM_INTERVAL]=100; } - g_com_map[VERSION] = 0x011c; + g_com_map[VERSION] = 0x0126; + g_com_map[SW_TYPE] = SW_FANGZHUANG; dev_id = g_com_map[DEV_ID]; slottime=ceil((double)g_com_map[MAX_REPORT_ANC_NUM]*SLOT_SCALE)+3; max_slotpos=g_com_map[COM_INTERVAL]/slottime; tyncpoll_time=(g_com_map[DEV_ID]%max_slotpos)*slottime; module_power = g_com_map[POWER]; total_slotnum = 1000/g_com_map[COM_INTERVAL]; + vel_factor=g_com_map[FILTER_COEFFICIENT]; + pos_factor=g_com_map[FILTER_COEFFICIENT]; + if(module_power>67) { module_power=67; @@ -151,6 +156,16 @@ } if(flag_newsecond) { + uint32_t temp23; + temp23 = dwt_read32bitreg(CHAN_CTRL_ID) ; + if(temp23!=0x4A480022) + { + temp23 = dwt_read32bitreg(CHAN_CTRL_ID) ; + if(temp23!=0x4A480022) + { + NVIC_SystemReset(); + } + } flag_newsecond=0; tagpos_binary=0; memcpy(ancidlist_send,ancidlist_rec,ancidlist_num*2); @@ -162,7 +177,7 @@ tagpos_rec[i] = 0; } } - if(target_time>1000) + if(target_time>=1000) {target_time-=1000;} #ifdef USART_INTEGRATE_OUTPUT if(g_com_map[DEV_ROLE]==0&&usart_send_flag) -- Gitblit v1.9.3