From af4710835316cb2fd8dd70db7867e23147206f31 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期四, 17 二月 2022 09:33:48 +0800 Subject: [PATCH] 增加跳跃时间 --- 源码/核心板/Src/main.c | 39 +++++++++++++++++++++++++-------------- 1 files changed, 25 insertions(+), 14 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 f341743..f0d9492 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" @@ -14,7 +14,6 @@ #include "deca_device_api.h" #include "Flash.h" //#define DEBUG_MODE - void Device_Init(void) { RCC_Configuration(); @@ -52,7 +51,7 @@ uint16_t vel_factor,pos_factor; extern u8 module_power; -u16 slottime,max_slotnum,current_slotpos; +u16 slottime,max_slotnum,current_slotpos,dist_threshold; void Program_Init(void) {uint16_t i; float temp; @@ -75,11 +74,17 @@ // g_com_map[ALARM_DISTANCE1]=100; g_com_map[FILTER_COEFFICIENT]=12; #endif + //g_com_map[COM_INTERVAL]=1000; //pUWBDistanceTrackingDiff = NewTrackingDiffClass(2, 4, 0.03); dev_id = g_com_map[DEV_ID]; group_id=g_com_map[GROUP_ID]; vel_factor=g_com_map[FILTER_COEFFICIENT]; pos_factor=g_com_map[FILTER_COEFFICIENT]; + dist_threshold = (g_com_map[SPEEDFILTER_THRES]*10)/(1000/g_com_map[COM_INTERVAL]); + if(dist_threshold<300) + {dist_threshold = 300;} + if(dist_threshold>15000) + {dist_threshold = 15000;} if(dev_id==0) sync_mainbase=1; module_power = g_com_map[POWER]; @@ -87,7 +92,8 @@ { module_power=67; } - g_com_map[VERSION] = 0x0123; + g_com_map[VERSION] = 0x012c; + g_com_map[SW_TYPE] = SW_MODBUS; temp=(float)g_com_map[MAX_REPORT_ANC_NUM]*4/3; temp2=g_com_map[MAX_REPORT_ANC_NUM]*4/3; if(temp2<temp) @@ -198,19 +204,24 @@ Modbus_RegMap(); while(1) { - if(g_start_send_flag) - { - g_start_send_flag = 0; - temp=dwt_readtempvbat(1); - dw_vbat=(float)((temp&0xff)-173)/173+3.3; - if(dw_vbat>2.8) - Tag_App(); - }//else{ +// if(g_com_map[0] != 0x55AA) +// { +// while(1) +// IdleTask(); +// } +// if(g_start_send_flag) +// { +// g_start_send_flag = 0; +// temp=dwt_readtempvbat(1); +// dw_vbat=(float)((temp&0xff)-173)/173+3.3; +// if(dw_vbat>2.8) +// Tag_App(); +// }//else{ IdleTask(); -// } -// +//// } +//// if(g_com_map[DEV_ROLE]==0) - Anchor_App(); + RecOnePackData(); } -- Gitblit v1.9.3