Rev 78 | Rev 92 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 78 | Rev 91 | ||
---|---|---|---|
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 14 |
6 | #define VERSION_MINOR 14 |
7 | #define VERSION_PATCH 4 |
7 | #define VERSION_PATCH 4 |
8 | 8 | ||
9 | #define VERSION_SERIAL_MAJOR 10 |
9 | #define VERSION_SERIAL_MAJOR 10 |
10 | #define VERSION_SERIAL_MINOR 0 |
10 | #define VERSION_SERIAL_MINOR 0 |
11 | 11 | ||
12 | #define FC_SPI_COMPATIBLE 5 |
12 | #define FC_SPI_COMPATIBLE 6 |
13 | #define MK3MAG_I2C_COMPATIBLE 2 |
13 | #define MK3MAG_I2C_COMPATIBLE 2 |
14 | 14 | ||
15 | 15 | ||
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 | // sends data on uart0 (without MK-OSD the MKGPS is connect there) |
25 | // sends data on uart0 (without MK-OSD the MKGPS is connect there) |
26 | //#define SEND_MKOSD_DATA |
26 | //#define SEND_MKOSD_DATA |
27 | 27 | ||
28 | extern u32 TimerCompassUpdate; |
28 | extern u32 TimerCompassUpdate; |
29 | extern u16 BeepTime; |
29 | extern u16 BeepTime; |
30 | extern u8 ClearMKFlags; |
30 | extern u8 ClearMKFlags; |
31 | void Interrupt_Init(void); |
31 | void Interrupt_Init(void); |
32 | 32 | ||
33 | typedef struct |
33 | typedef struct |
34 | { |
34 | { |
35 | u8 ActiveSetting; |
35 | u8 ActiveSetting; |
36 | u8 User1; |
36 | u8 User1; |
37 | u8 User2; |
37 | u8 User2; |
38 | u8 User3; |
38 | u8 User3; |
39 | u8 User4; |
39 | u8 User4; |
40 | u8 User5; |
40 | u8 User5; |
41 | u8 User6; |
41 | u8 User6; |
42 | u8 User7; |
42 | u8 User7; |
43 | u8 User8; |
43 | u8 User8; |
44 | u8 NaviGpsModeControl; |
44 | u8 NaviGpsModeControl; |
45 | u8 NaviGpsGain; |
45 | u8 NaviGpsGain; |
46 | u8 NaviGpsP; |
46 | u8 NaviGpsP; |
47 | u8 NaviGpsI; |
47 | u8 NaviGpsI; |
48 | u8 NaviGpsD; |
48 | u8 NaviGpsD; |
49 | u8 NaviGpsPLimit; |
49 | u8 NaviGpsPLimit; |
50 | u8 NaviGpsILimit; |
50 | u8 NaviGpsILimit; |
51 | u8 NaviGpsDLimit; |
51 | u8 NaviGpsDLimit; |
52 | u8 NaviGpsACC; |
52 | u8 NaviGpsACC; |
53 | u8 NaviGpsMinSat; |
53 | u8 NaviGpsMinSat; |
54 | u8 NaviStickThreshold; |
54 | u8 NaviStickThreshold; |
55 | u8 NaviOperatingRadius; |
55 | u8 NaviOperatingRadius; |
56 | u8 NaviWindCorrection; |
56 | u8 NaviWindCorrection; |
57 | u8 NaviSpeedCompensation; |
57 | u8 NaviSpeedCompensation; |
58 | u8 LowVoltageWarning; |
58 | u8 LowVoltageWarning; |
59 | u8 NaviAngleLimitation; |
59 | u8 NaviAngleLimitation; |
60 | u8 NaviPH_LoginTime; |
60 | u8 NaviPH_LoginTime; |
61 | } __attribute__((packed)) Param_t; |
61 | } __attribute__((packed)) Param_t; |
62 | 62 | ||
63 | typedef struct |
63 | typedef struct |
64 | { |
64 | { |
65 | s8 StickNick; |
65 | s8 StickNick; |
66 | s8 StickRoll; |
66 | s8 StickRoll; |
67 | s8 StickYaw; |
67 | s8 StickYaw; |
68 | s8 StickGas; |
68 | s8 StickGas; |
69 | u8 Poti1; |
69 | u8 Poti1; |
70 | u8 Poti2; |
70 | u8 Poti2; |
71 | u8 Poti3; |
71 | u8 Poti3; |
72 | u8 Poti4; |
72 | u8 Poti4; |
73 | u8 RC_Quality; |
73 | u8 RC_Quality; |
74 | u8 UBat; |
74 | u8 UBat; |
75 | // MK_Flags |
75 | // MK_Flags |
76 | u8 MKFlags; |
76 | u8 MKFlags; |
77 | } __attribute__((packed)) FC_t; |
77 | } __attribute__((packed)) FC_t; |
78 | 78 | ||
79 | 79 | ||
80 | extern Param_t Parameter; |
80 | extern Param_t Parameter; |
81 | extern volatile FC_t FC; |
81 | extern volatile FC_t FC; |
82 | extern s8 ErrorMSG[25]; |
82 | extern s8 ErrorMSG[25]; |
83 | extern u32 ErrorCode; |
83 | extern u32 ErrorCode; |
84 | extern u8 StopNavigation; |
84 | extern u8 StopNavigation; |
85 | #endif // _MAIN_H |
85 | #endif // _MAIN_H |
86 | 86 |