From d3a77da7be3808ce65448dbfa9d43d13ba9e0ecd Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期二, 17 八月 2021 14:58:21 +0800 Subject: [PATCH] 增加基站状态输出,增加map表对比 --- 源码/核心板/Src/application/global_param.h | 70 ++++++++++++++++++++++++++++++----- 1 files changed, 60 insertions(+), 10 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.h" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.h" index 977da01..0bf484b 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.h" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/global_param.h" @@ -3,22 +3,72 @@ #include "stm32f10x.h" -#define COM_MAP_SIZE 1024 - - +#define COM_MAP_SIZE 512 //MAP表的最大空间 +#define DEFAULT_DISTANCE 1000 //初始测距距离为10米 +#define DEFAULT_DEV_ID 5555 //默认设备ID是5555 +#define SYNCLOST_TIME 10000 //多久收不到信号变成同步基站 /*---------------Map Definition-------------------*/ -#define DEV_ROLE 0x10 //该设备是anchor还是tag -#define DEV_ID 0x11 //设备的Id号 -#define COM_INTERVAL 0x12 //通讯间隔 -#define DEV_GROUP_ID 0x13 //通讯组ID +#define MAP_SIGN_INDEX 0x0 +#define VERSION 0x1 +#define DEV_ID 0x2 //设备的Id +#define COM_INTERVAL 0x3 //通讯间隔 +#define MAX_REPORT_ANC_NUM 0x4 //单次通讯基站上限 +#define MIN_REPORT_ANC_NUM 0x5 //单次通讯基站下限 +#define DIST_OFFSET 0x6 +#define DEV_ROLE 0x7 //该设备是anchor还是tag +#define ANC_POLL 0x8 //该设备是anchor还是tag -#define ALARM_DEV 0x20 //是哪个设备报警 -#define ALARM_DISTANCE 0x21 //小于多少距离报警 +#define ALARM_DEV 0x9 //是哪个设备报警 +#define ALARM_DISTANCE1 0xA //小于多少距离报警 +#define NEARSWITCH_DISTANCE_INDEX 0x0A +#define ALARM_DISTANCE2 0xB //小于多少距离报警 +#define ALARM_DISTANCE3 0xC //小于多少距离报警 +#define PAIR_ID 0xD //小于多少距离报警 +#define HEARTBEAT 0xE +#define NEARBASE_NUM 0x10 +#define NEARBASE_ID1 0x11 +#define NEARBASE_ID2 0x12 +#define NEARBASE_ID3 0x13 +#define NEARBASE_ID4 0x14 +#define NEARBASE_ID5 0x15 +#define NEARBASE_ID6 0x16 +#define NEARBASE_ID7 0x17 +#define NEARBASE_ID8 0x18 +#define NEARBASE_ID9 0x19 +#define NEARBASE_ID10 0x1a + +#define POWER 0x1B +#define IMU_THRES 0x1C +#define NOMOVESLEEP_TIME 0x1D +#define MOTOR_ENABLE 0x1E +#define IMU_ENABLE 0x1F +#define FILTER_COEFFICIENT 0x20 +#define SYNCBASEID 0x22 +#define BASESYNCSEQ 0x23 +#define HEIGHTOFFEST_INDEX 0x28 + +#define CNT_RESTART 0x30 +#define CNT_REBOOT 0x31 +#define CNT_UPDATE 0x32 + +#define BOARD_TYPE 0x40 //板子类型 + +#define ANC_FLAG 0x100 + + + + +///////////////////STATE MAP///////////////// +#define SM_RESTART 1 +#define SM_UPDATE 2 +#define SM_UPDATEFAIL 3 +#define SM_BOOTFAIL 4 +#define SM_MAPERROR 5 /*------------END Map Definition-------------------*/ -extern uint16_t g_com_map[COM_MAP_SIZE]; +extern uint16_t g_com_map[COM_MAP_SIZE],g_com_map2[COM_MAP_SIZE]; extern uint32_t save_com_map_to_flash(void); extern void parameter_init(void); -- Gitblit v1.9.3