Subversion Repositories NaviCtrl

Rev

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