Subversion Repositories NaviCtrl

Rev

Rev 68 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef _MAIN_H
#define _MAIN_H


#define VERSION_MAJOR   0
#define VERSION_MINOR   14
#define VERSION_PATCH   0

#define VERSION_SERIAL_MAJOR    10
#define VERSION_SERIAL_MINOR    0
 
#define FC_SPI_COMPATIBLE       5
#define MK3MAG_I2C_COMPATIBLE   2

// sends data on uart0 (without MK-OSD the MKGPS is connect there)
//#define SEND_MKOSD_DATA

extern u32 TimerCompassUpdate;
extern u16 BeepTime;
extern u8 ClearMKFlags;
void Interrupt_Init(void);

typedef struct
{
        u8 ActiveSetting;
        u8 User1;
        u8 User2;
        u8 User3;
        u8 User4;
        u8 User5;
        u8 User6;
        u8 User7;
        u8 User8;
        u8 NaviGpsModeControl;
        u8 NaviGpsGain;
        u8 NaviGpsP;
        u8 NaviGpsI;
        u8 NaviGpsD;
        u8 NaviGpsPLimit;
        u8 NaviGpsILimit;
        u8 NaviGpsDLimit;
        u8 NaviGpsACC;
        u8 NaviGpsMinSat;
        u8 NaviStickThreshold;
        u8 NaviOperatingRadius;
        u8 NaviWindCorrection;
        u8 NaviSpeedCompensation;
        u8 LowVoltageWarning;
        u8 NaviAngleLimitation;
        u8 NaviPH_LoginTime;
} __attribute__((packed)) Param_t;

typedef struct
{
        s8 StickNick;
        s8 StickRoll;
        s8 StickYaw;
        s8 StickGas;
        u8 Poti1;
        u8 Poti2;
        u8 Poti3;
        u8 Poti4;
        u8 RC_Quality;
        u8 UBat;
        // MK_Flags
        #define MKFLAG_MOTOR_RUN                                0x01
        #define MKFLAG_FLY                                      0x02
        #define MKFLAG_CALIBRATE                                0x04
        #define MKFLAG_START                                    0x08
        #define MKFLAG_EMERGENCY_LANDING        0x10
        #define MKFLAG_RESERVE1                         0x20
        #define MKFLAG_RESERVE2                         0x40
        #define MKFLAG_RESERVE3                         0x80
        u8 MKFlags;
} __attribute__((packed)) FC_t;


extern Param_t Parameter;
extern FC_t FC;
extern s8 ErrorMSG[25];
extern u32 ErrorCode;
extern u8 StopNavigation;
#endif // _MAIN_H