WXK
2023-03-17 6f05c0c8a8e5b4ccabc20cb75b57bd59ef145bcc
Src/application/dw_app.h
@@ -8,12 +8,21 @@
#include "ADC.h"
#include "TrackingDiff.h"
//#define WORK_MODE_TAG
#define WORK_MODE_ANCHOR
#define MAX_ANCFREQ    20//基站频率上限
#define NOTAG_FREQ     1// 无标签情况下,基站定位频率
#define FREQ_LOST_TIME   30 // 标签无信号恢复频率1HZ时间。秒
#define SENDANCPARA_LEN 102
#define BASELOST_STOPMOTOR_TIME 5
//BITSTATE
#define GOINGSLEEPBIT 1
//#define NEWBOARD
//#define TAG_OUTPUT
#define HEX_OUTPUT
#define SLOT_SCALE 0.7
#define MAX_NEARBASE_NUM 12
#define KEEP_TIMES 3
#define REPOET_ANC_NUM 1
#define REPOET_ANC_NUM_MIN 1
@@ -24,29 +33,40 @@
#define THRESHOLD_CHANGE_MAINBASE_DIST   50
#define MIN_ANCHOR_NUM 2
#define SYNC_SEQ_IDX             5
#define REMOTEPARA_LEN 18
#define POLL                          0x01
#define RESPONSE                      0x02
#define FINAL                        0x03
#define SYNC                           0x04
#define NEAR_MSG                     0x05
#define NEAR_POLL                  0x06
#define NEAR_RESPONSE            0x07
#define NEAR_FINAL                  0x08
//#define NEAR_POLL                      0x06
//#define NEAR_RESPONSE                    0x07
//#define NEAR_FINAL                      0x08
//#define NEAR_PRAAREPLY                  0x20
#define MBX_POLL                          0x20
#define MBX_RESPONSE                        0x21
#define MBX_FINAL                      0x22
#define MBX_PRAAREPLY                  0x23
//General
#define GROUP_ID_IDX               0
#define ANCHOR_ID_IDX             1
#define TAG_ID_IDX                5
#define MESSAGE_TYPE_IDX          9   
#define MESSAGE_PARAREPLY_IDX       10
//Poll
#define TAGSTATE              7
#define ANC_TYPE_IDX                14
//respose
#define DIST_IDX                      10
#define ANCTIMEMS             14
#define ANCTIMEUS             16
#define TAGSLOTPOS                  7
#define TAGFREQ_IDX                  7
#define MOTORSTATE_INDEX      19
#define REMOTEPARA_INDEX      22
//Final
#define TAGCONFIGSUCCESS_INDEX 7
#define FINAL_MSG_POLL_TX_TS_IDX 10
#define FINAL_MSG_RESP_RX_TS_IDX 14
#define FINAL_MSG_FINAL_TX_TS_IDX 18
@@ -55,12 +75,15 @@
//SYNC
#define SYNC_SEQ_IDX             5
//NEAR MSG
#define NEARMSG_EMPTYSLOTPOS_INDEX       1 //RESPONSE
#define NEARBASENUM_INDEX    10
#define NEARBASEID_INDEX       11
//NEAR POLL
#define BATTARY_IDX                  1
#define BUTTON_IDX                  2
#define SEQUENCE_IDX               3
#define BATTARY_IDX                  4
#define BUTTON_IDX                  7
#define DW_CTRL_GPIO               GPIOA
#define DW_ENABLE   HAL_GPIO_WritePin(DW_CTRL_GPIO, DW_CTRL_Pin, GPIO_PIN_RESET)