zhyinch
2021-08-17 d3a77da7be3808ce65448dbfa9d43d13ba9e0ecd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef __GLOBAL_PARAM_H__
#define __GLOBAL_PARAM_H__
 
#include "stm32f10x.h"
 
#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   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                        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],g_com_map2[COM_MAP_SIZE];
 
extern uint32_t save_com_map_to_flash(void);
extern void parameter_init(void);
 
#endif