Rev 41 | Rev 50 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 41 | Rev 49 | ||
---|---|---|---|
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 12 |
6 | #define VERSION_MINOR 12 |
7 | #define VERSION_PATCH 8 |
7 | #define VERSION_PATCH 9 |
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 3 |
12 | #define FC_SPI_COMPATIBLE 3 |
13 | #define MK3MAG_I2C_COMPATIBLE 2 |
13 | #define MK3MAG_I2C_COMPATIBLE 2 |
- | 14 | ||
- | 15 | // sends data on uart0 (without MK-OSD the MKGPS is connect there) |
|
- | 16 | #define SEND_MKOSD_DATA |
|
14 | 17 | ||
15 | extern u32 TimerCompassUpdate; |
18 | extern u32 TimerCompassUpdate; |
16 | extern u16 BeepTime; |
19 | extern u16 BeepTime; |
17 | extern u8 ClearMKFlags; |
20 | extern u8 ClearMKFlags; |
18 | void Interrupt_Init(void); |
21 | void Interrupt_Init(void); |
19 | 22 | ||
20 | typedef struct |
23 | typedef struct |
21 | { |
24 | { |
22 | u8 ActiveSetting; |
25 | u8 ActiveSetting; |
23 | u8 User1; |
26 | u8 User1; |
24 | u8 User2; |
27 | u8 User2; |
25 | u8 User3; |
28 | u8 User3; |
26 | u8 User4; |
29 | u8 User4; |
27 | u8 User5; |
30 | u8 User5; |
28 | u8 User6; |
31 | u8 User6; |
29 | u8 User7; |
32 | u8 User7; |
30 | u8 User8; |
33 | u8 User8; |
31 | u8 NaviGpsModeControl; |
34 | u8 NaviGpsModeControl; |
32 | u8 NaviGpsGain; |
35 | u8 NaviGpsGain; |
33 | u8 NaviGpsP; |
36 | u8 NaviGpsP; |
34 | u8 NaviGpsI; |
37 | u8 NaviGpsI; |
35 | u8 NaviGpsD; |
38 | u8 NaviGpsD; |
36 | u8 NaviGpsACC; |
39 | u8 NaviGpsACC; |
37 | u8 NaviGpsMinSat; |
40 | u8 NaviGpsMinSat; |
38 | u8 NaviStickThreshold; |
41 | u8 NaviStickThreshold; |
39 | u8 NaviOperatingRadius; |
42 | u8 NaviOperatingRadius; |
40 | u8 NaviWindCorrection; |
43 | u8 NaviWindCorrection; |
41 | u8 NaviSpeedCompensation; |
44 | u8 NaviSpeedCompensation; |
42 | u8 LowVoltageWarning; |
45 | u8 LowVoltageWarning; |
43 | u8 NaviAngleLimitation; |
46 | u8 NaviAngleLimitation; |
44 | } __attribute__((packed)) Param_t; |
47 | } __attribute__((packed)) Param_t; |
45 | 48 | ||
46 | typedef struct |
49 | typedef struct |
47 | { |
50 | { |
48 | s8 StickNick; |
51 | s8 StickNick; |
49 | s8 StickRoll; |
52 | s8 StickRoll; |
50 | s8 StickYaw; |
53 | s8 StickYaw; |
51 | s8 StickGas; |
54 | s8 StickGas; |
52 | u8 Poti1; |
55 | u8 Poti1; |
53 | u8 Poti2; |
56 | u8 Poti2; |
54 | u8 Poti3; |
57 | u8 Poti3; |
55 | u8 Poti4; |
58 | u8 Poti4; |
56 | u8 RC_Quality; |
59 | u8 RC_Quality; |
57 | u8 UBat; |
60 | u8 UBat; |
58 | // MK_Flags |
61 | // MK_Flags |
59 | #define MKFLAG_MOTOR_RUN 0x01 |
62 | #define MKFLAG_MOTOR_RUN 0x01 |
60 | #define MKFLAG_FLY 0x02 |
63 | #define MKFLAG_FLY 0x02 |
61 | #define MKFLAG_CALIBRATE 0x04 |
64 | #define MKFLAG_CALIBRATE 0x04 |
62 | #define MKFLAG_START 0x08 |
65 | #define MKFLAG_START 0x08 |
63 | #define MKFLAG_EMERGENCY_LANDING 0x10 |
66 | #define MKFLAG_EMERGENCY_LANDING 0x10 |
64 | #define MKFLAG_RESERVE1 0x20 |
67 | #define MKFLAG_RESERVE1 0x20 |
65 | #define MKFLAG_RESERVE2 0x40 |
68 | #define MKFLAG_RESERVE2 0x40 |
66 | #define MKFLAG_RESERVE3 0x80 |
69 | #define MKFLAG_RESERVE3 0x80 |
67 | u8 MKFlags; |
70 | u8 MKFlags; |
68 | } __attribute__((packed)) FC_t; |
71 | } __attribute__((packed)) FC_t; |
69 | 72 | ||
70 | 73 | ||
71 | extern Param_t Parameter; |
74 | extern Param_t Parameter; |
72 | extern FC_t FC; |
75 | extern FC_t FC; |
73 | extern s8 ErrorMSG[25]; |
76 | extern s8 ErrorMSG[25]; |
74 | extern u32 ErrorCode; |
77 | extern u32 ErrorCode; |
75 | extern u8 StopNavigation; |
78 | extern u8 StopNavigation; |
76 | #endif // _MAIN_H |
79 | #endif // _MAIN_H |
77 | 80 |