Rev 151 | Rev 160 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 151 | Rev 153 | ||
---|---|---|---|
1 | #ifndef _MAIN_H |
1 | #ifndef _MAIN_H |
2 | #define _MAIN_H |
2 | #define _MAIN_H |
3 | 3 | ||
4 | 4 | ||
5 | #define VERSION_MAJOR 0 |
5 | #define VERSION_MAJOR 0 |
6 | #define VERSION_MINOR 16 |
6 | #define VERSION_MINOR 16 |
7 | #define VERSION_PATCH 6 |
7 | #define VERSION_PATCH 6 |
8 | 8 | ||
9 | #define VERSION_SERIAL_MAJOR 10 |
9 | #define VERSION_SERIAL_MAJOR 10 |
10 | #define VERSION_SERIAL_MINOR 1 |
10 | #define VERSION_SERIAL_MINOR 1 |
11 | 11 | ||
12 | #define FC_SPI_COMPATIBLE 9 |
12 | #define FC_SPI_COMPATIBLE 9 |
13 | #define MK3MAG_I2C_COMPATIBLE 3 |
13 | #define MK3MAG_I2C_COMPATIBLE 3 |
14 | 14 | ||
15 | // FC FLAGS |
15 | // FC FLAGS |
16 | #define MKFLAG_MOTOR_RUN 0x01 |
16 | #define MKFLAG_MOTOR_RUN 0x01 |
17 | #define MKFLAG_FLY 0x02 |
17 | #define MKFLAG_FLY 0x02 |
18 | #define MKFLAG_CALIBRATE 0x04 |
18 | #define MKFLAG_CALIBRATE 0x04 |
19 | #define MKFLAG_START 0x08 |
19 | #define MKFLAG_START 0x08 |
20 | #define MKFLAG_EMERGENCY_LANDING 0x10 |
20 | #define MKFLAG_EMERGENCY_LANDING 0x10 |
21 | #define MKFLAG_RESERVE1 0x20 |
21 | #define MKFLAG_RESERVE1 0x20 |
22 | #define MKFLAG_RESERVE2 0x40 |
22 | #define MKFLAG_RESERVE2 0x40 |
23 | #define MKFLAG_RESERVE3 0x80 |
23 | #define MKFLAG_RESERVE3 0x80 |
24 | 24 | ||
25 | // NC Errors |
25 | // NC Errors |
26 | #define NCERR_FLAG_FC_COMPATIBLE 0x00000001 |
26 | #define NCERR_FLAG_FC_COMPATIBLE 0x00000001 |
27 | #define NCERR_FLAG_MK3MAG_COMPATIBLE 0x00000002 |
27 | #define NCERR_FLAG_MK3MAG_COMPATIBLE 0x00000002 |
28 | #define NCERR_FLAG_FC_COMMUNICATION 0x00000004 |
28 | #define NCERR_FLAG_FC_COMMUNICATION 0x00000004 |
29 | #define NCERR_FLAG_MK3MAG_COMMUNICATION 0x00000008 |
29 | #define NCERR_FLAG_MK3MAG_COMMUNICATION 0x00000008 |
30 | #define NCERR_FLAG_MKGPS_COMMUNICATION 0x00000010 |
30 | #define NCERR_FLAG_MKGPS_COMMUNICATION 0x00000010 |
31 | #define NCERR_FLAG_BAD_COMPASS_HEADING 0x00000020 |
31 | #define NCERR_FLAG_BAD_COMPASS_HEADING 0x00000020 |
32 | #define NCERR_FLAG_RC_SIGNAL_LOST 0x00000040 |
32 | #define NCERR_FLAG_RC_SIGNAL_LOST 0x00000040 |
33 | 33 | ||
34 | extern u16 BeepTime; |
34 | extern u16 BeepTime; |
35 | extern u8 NCFlags; |
35 | extern u8 NCFlags; |
36 | extern u8 ClearMKFlags; |
36 | extern u8 ClearMKFlags; |
37 | void Interrupt_Init(void); |
37 | void Interrupt_Init(void); |
38 | extern s32 GeoMag; |
38 | extern s16 GeoMagDec; |
39 | 39 | ||
40 | 40 | ||
41 | typedef struct |
41 | typedef struct |
42 | { |
42 | { |
43 | u8 ActiveSetting; |
43 | u8 ActiveSetting; |
44 | u8 User1; |
44 | u8 User1; |
45 | u8 User2; |
45 | u8 User2; |
46 | u8 User3; |
46 | u8 User3; |
47 | u8 User4; |
47 | u8 User4; |
48 | u8 User5; |
48 | u8 User5; |
49 | u8 User6; |
49 | u8 User6; |
50 | u8 User7; |
50 | u8 User7; |
51 | u8 User8; |
51 | u8 User8; |
52 | u8 NaviGpsModeControl; |
52 | u8 NaviGpsModeControl; |
53 | u8 NaviGpsGain; |
53 | u8 NaviGpsGain; |
54 | u8 NaviGpsP; |
54 | u8 NaviGpsP; |
55 | u8 NaviGpsI; |
55 | u8 NaviGpsI; |
56 | u8 NaviGpsD; |
56 | u8 NaviGpsD; |
57 | u8 NaviGpsPLimit; |
57 | u8 NaviGpsPLimit; |
58 | u8 NaviGpsILimit; |
58 | u8 NaviGpsILimit; |
59 | u8 NaviGpsDLimit; |
59 | u8 NaviGpsDLimit; |
60 | u8 NaviGpsACC; |
60 | u8 NaviGpsACC; |
61 | u8 NaviGpsMinSat; |
61 | u8 NaviGpsMinSat; |
62 | u8 NaviStickThreshold; |
62 | u8 NaviStickThreshold; |
63 | u8 NaviOperatingRadius; |
63 | u8 NaviOperatingRadius; |
64 | u8 NaviWindCorrection; |
64 | u8 NaviWindCorrection; |
65 | u8 NaviSpeedCompensation; |
65 | u8 NaviSpeedCompensation; |
66 | u8 LowVoltageWarning; |
66 | u8 LowVoltageWarning; |
67 | u8 NaviAngleLimitation; |
67 | u8 NaviAngleLimitation; |
68 | u8 NaviPH_LoginTime; |
68 | u8 NaviPH_LoginTime; |
69 | } __attribute__((packed)) Param_t; |
69 | } __attribute__((packed)) Param_t; |
70 | 70 | ||
71 | typedef struct |
71 | typedef struct |
72 | { |
72 | { |
73 | s8 StickNick; |
73 | s8 StickNick; |
74 | s8 StickRoll; |
74 | s8 StickRoll; |
75 | s8 StickYaw; |
75 | s8 StickYaw; |
76 | s8 StickGas; |
76 | s8 StickGas; |
77 | u8 Poti1; |
77 | u8 Poti1; |
78 | u8 Poti2; |
78 | u8 Poti2; |
79 | u8 Poti3; |
79 | u8 Poti3; |
80 | u8 Poti4; |
80 | u8 Poti4; |
81 | u8 RC_Quality; |
81 | u8 RC_Quality; |
82 | u8 RC_RSSI; |
82 | u8 RC_RSSI; |
83 | u8 UBat; |
83 | u8 UBat; |
84 | u8 MKFlags; |
84 | u8 MKFlags; |
85 | } __attribute__((packed)) FC_t; |
85 | } __attribute__((packed)) FC_t; |
86 | 86 | ||
87 | 87 | ||
88 | extern Param_t Parameter; |
88 | extern Param_t Parameter; |
89 | extern volatile FC_t FC; |
89 | extern volatile FC_t FC; |
90 | extern s8 ErrorMSG[25]; |
90 | extern s8 ErrorMSG[25]; |
91 | extern u32 ErrorCode; |
91 | extern u32 ErrorCode; |
92 | extern u8 StopNavigation; |
92 | extern u8 StopNavigation; |
93 | #endif // _MAIN_H |
93 | #endif // _MAIN_H |
94 | 94 |