Rev 39 | Rev 49 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 39 | Rev 41 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | #ifndef _MAIN_H |
|
- | 2 | #define _MAIN_H |
|
Line 1... | Line -... | ||
1 | - | ||
2 | #include "91x_conf.h" |
- | |
3 | #include "91x_lib.h" |
- | |
4 | #include "91x_wiu.h" |
- | |
5 | #include "uart.h" |
- | |
6 | #include "ramfunc.h" |
- | |
7 | #include "menu.h" |
- | |
8 | #include <stdio.h> |
- | |
9 | #include <stdlib.h> |
- | |
10 | #include <math.h> |
- | |
11 | #include "printf_P.h" |
- | |
12 | #include "timer.h" |
- | |
13 | #include "spi_slave.h" |
- | |
14 | #include "i2c.h" |
- | |
15 | #include "GPS.h" |
- | |
16 | #include "GPSUart.h" |
- | |
17 | #include "sdc.h" |
- | |
18 | #include "ssc.h" |
- | |
19 | #include "fat16.h" |
- | |
20 | #include "usb.h" |
- | |
21 | #include "string.h" |
- | |
22 | #include "settings.h" |
- | |
23 | - | ||
24 | //#include "hw_config.h" |
- | |
25 | - | ||
26 | #define VERSION_HAUPTVERSION 0 |
- | |
27 | #define VERSION_NEBENVERSION 4 |
- | |
28 | #define VERSION_KOMPATIBEL 7 |
- | |
29 | - | ||
Line -... | Line 3... | ||
- | 3 | ||
- | 4 | ||
- | 5 | #define VERSION_MAJOR 0 |
|
- | 6 | #define VERSION_MINOR 12 |
|
- | 7 | #define VERSION_PATCH 8 |
|
- | 8 | ||
- | 9 | #define VERSION_SERIAL_MAJOR 10 |
|
- | 10 | #define VERSION_SERIAL_MINOR 0 |
|
- | 11 | ||
Line 30... | Line 12... | ||
30 | #define GPIO_ToggleBit(GPIO, Pin) if (GPIO_ReadBit(GPIO, Pin)) GPIO_WriteBit(GPIO, Pin, Bit_RESET); else GPIO_WriteBit(GPIO, Pin, Bit_SET); |
12 | #define FC_SPI_COMPATIBLE 3 |
31 | 13 | #define MK3MAG_I2C_COMPATIBLE 2 |
|
32 | 14 | ||
33 | extern u32 TimerCompassUpdate; |
15 | extern u32 TimerCompassUpdate; |
34 | extern u32 TimerI2CReadDelay; |
16 | extern u16 BeepTime; |
- | 17 | extern u8 ClearMKFlags; |
|
- | 18 | void Interrupt_Init(void); |
|
35 | extern u8 BeepTime; |
19 | |
36 | void InitInterrupt(void); |
20 | typedef struct |
37 | 21 | { |
|
38 | extern u8 text[20]; |
22 | u8 ActiveSetting; |
39 | extern u8 Parameter_UserParam1; |
23 | u8 User1; |
40 | extern u8 Parameter_UserParam2; |
24 | u8 User2; |
41 | extern u8 Parameter_UserParam3; |
25 | u8 User3; |
42 | extern u8 Parameter_UserParam4; |
26 | u8 User4; |
43 | extern u8 Parameter_UserParam5; |
27 | u8 User5; |
44 | extern u8 Parameter_UserParam6; |
28 | u8 User6; |
45 | extern u8 Parameter_UserParam7; |
29 | u8 User7; |
46 | extern u8 Parameter_UserParam8; |
30 | u8 User8; |
47 | extern s32 FC_StickNick; |
31 | u8 NaviGpsModeControl; |
48 | extern s32 FC_StickRoll; |
32 | u8 NaviGpsGain; |
49 | extern s32 FC_StickGier; |
33 | u8 NaviGpsP; |
50 | extern s32 FC_StickGas; |
34 | u8 NaviGpsI; |
51 | extern s32 FC_Poti1; |
35 | u8 NaviGpsD; |
52 | extern s32 FC_Poti2; |
36 | u8 NaviGpsACC; |
53 | extern s32 FC_Poti3; |
37 | u8 NaviGpsMinSat; |
54 | extern s32 FC_Poti4; |
38 | u8 NaviStickThreshold; |
55 | extern s32 SenderOkay; |
39 | u8 NaviOperatingRadius; |
56 | extern s32 UBat; |
40 | u8 NaviWindCorrection; |
57 | extern s32 UndervoltageLevel; |
41 | u8 NaviSpeedCompensation; |
- | 42 | u8 LowVoltageWarning; |
|
58 | extern s32 ActiveSetting; |
43 | u8 NaviAngleLimitation; |
- | 44 | } __attribute__((packed)) Param_t; |
|
59 | //++++++++++++++++++++++++++++++++++++++++++++++++++ |
45 | |
60 | extern s32 Parameter_NaviGpsModeControl; |
46 | typedef struct |
61 | extern s32 Parameter_NaviGpsGain; |
47 | { |
62 | extern s32 Parameter_NaviGpsP; |
48 | s8 StickNick; |
- | 49 | s8 StickRoll; |
|
- | 50 | s8 StickYaw; |
|
63 | extern s32 Parameter_NaviGpsI; |
51 | s8 StickGas; |
64 | extern s32 Parameter_NaviGpsD; |
52 | u8 Poti1; |
65 | extern s32 Parameter_NaviGpsACC; |
53 | u8 Poti2; |
- | 54 | u8 Poti3; |
|
66 | extern s32 Parameter_NaviGpsMinSat; |
55 | u8 Poti4; |
67 | extern s32 Parameter_NaviStickThreshold; |
56 | u8 RC_Quality; |
68 | extern s32 Parameter_RadiusAlert; |
57 | u8 UBat; |
69 | //++++++++++++++++++++++++++++++++++++++++++++++++++ |
58 | // MK_Flags |
70 | #define FLAG_MOTOR_RUN 1 |
59 | #define MKFLAG_MOTOR_RUN 0x01 |
- | 60 | #define MKFLAG_FLY 0x02 |
|
- | 61 | #define MKFLAG_CALIBRATE 0x04 |
|
- | 62 | #define MKFLAG_START 0x08 |
|
71 | #define FLAG_FLY 2 |
63 | #define MKFLAG_EMERGENCY_LANDING 0x10 |
72 | #define FLAG_CALIBRATE 4 |
64 | #define MKFLAG_RESERVE1 0x20 |
73 | #define FLAG_START 8 |
65 | #define MKFLAG_RESERVE2 0x40 |
- | 66 | #define MKFLAG_RESERVE3 0x80 |
|
74 | extern u32 MikroKopterFlags; |
67 | u8 MKFlags; |
- | 68 | } __attribute__((packed)) FC_t; |
|
- | 69 | ||
- | 70 | ||
- | 71 | extern Param_t Parameter; |
|
- | 72 | extern FC_t FC; |
|
- | 73 | extern s8 ErrorMSG[25]; |