From ffca10d02cc0913fba8f8d0dbe6051ebd8a0efe2 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期四, 12 十一月 2020 11:21:55 +0800 Subject: [PATCH] V1.31 无测距信息2s重启 --- 源码/核心板/Src/main.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 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 2a5ee9e..58ab4fb 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" @@ -52,6 +52,7 @@ uint16_t vel_factor,pos_factor; extern u8 module_power; +u16 slottime,max_slotnum,current_slotpos; void Program_Init(void) {uint16_t i; float temp; @@ -86,14 +87,17 @@ { module_power=67; } - g_com_map[VERSION] = 0x0117; + g_com_map[VERSION] = 0x011f; temp=(float)g_com_map[MAX_REPORT_ANC_NUM]*4/3; - temp2=g_com_map[DEV_ID]*g_com_map[MAX_REPORT_ANC_NUM]*4/3; + temp2=g_com_map[MAX_REPORT_ANC_NUM]*4/3; if(temp2<temp) { temp2++; } - tyncpoll_time=g_com_map[DEV_ID]*(temp2); + slottime=temp2; + max_slotnum=g_com_map[COM_INTERVAL]/temp2; + current_slotpos=g_com_map[DEV_ID]; + tyncpoll_time=(current_slotpos%max_slotnum)*slottime; if(g_com_map[DEV_ROLE]) { printf("标签ID: %d .\r\n",dev_id); -- Gitblit v1.9.3