Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 547 → Rev 548

/trunk/GPS.h
30,6 → 30,7
void GPS_Init(void);
void GPS_Navigation(gps_data_t *pGPS_Data, GPS_Stick_t* pGPS_Stick);
void CalcHeadFree(void);
void UBX_Setup(void);
 
#define EVENTFLAG_1_WP_CHANNEL 1
#define EVENTFLAG_2_WP_CHANNEL 2
/trunk/gpx.c
117,7 → 117,7
retvalue = 1; // the document could be created on the drive.
doc->state = GPX_DOC_OPENED; // change document state to opened. At next a placemark has to be opened.
fwrite_((void*)GPX_DOCUMENT_HEADER1, sizeof(GPX_DOCUMENT_HEADER1)-1,1,doc->file);// write the gpx-header to the document.
sprintf(string, "<desc>FC HW:%d.%d SW:%d.%02d%c + NC HW:%d.%d SW:%d.%02d%c BL:V%d", (FC_Version.Hardware & 0x7F)/10,(FC_Version.Hardware & 0x7F)%10, FC_Version.Major, FC_Version.Minor, 'a'+FC_Version.Patch, UART_VersionInfo.HWMajor/10, UART_VersionInfo.HWMajor%10, VERSION_MAJOR, VERSION_MINOR, 'a'+ VERSION_PATCH,BLv);
sprintf(string, "<desc>FC HW:%d.%d SW:%d.%02d%c + NC HW:%d.%d SW:%d.%02d%c + BL HW:V%d SW:%d.%02d", (FC_Version.Hardware & 0x7F)/10,(FC_Version.Hardware & 0x7F)%10, FC_Version.Major, FC_Version.Minor, 'a'+FC_Version.Patch, UART_VersionInfo.HWMajor/10, UART_VersionInfo.HWMajor%10, VERSION_MAJOR, VERSION_MINOR, 'a'+ VERSION_PATCH,BLv,UART_VersionInfo.BL_Firmware/100,UART_VersionInfo.BL_Firmware%100);
fputs_(string, doc->file);
if(FC.RedundanceBlOperation) sprintf(string, " (Redundant)</desc>\r\n");
else sprintf(string, "</desc>\r\n");
147,6 → 147,18
if(AbsoluteFlyingAltitude) {sprintf(string, "<MaxAltitude>%i</MaxAltitude>\r\n",AbsoluteFlyingAltitude);fputs_(string, doc->file);}
if(AbsoluteFlyingRange_m) {sprintf(string, "<FlyRange>%i</FlyRange>\r\n",AbsoluteFlyingRange_m);fputs_(string, doc->file);}
if(AutoDescendRange_m) {sprintf(string, "<Descend>%i</Descend>\r\n",AutoDescendRange_m);fputs_(string, doc->file);};
 
 
if((Parameter.GlobalConfig & FC_CFG_HEADING_HOLD)) {sprintf(string, "<HeadingHold>ON!</HeadingHold>\r\n");fputs_(string, doc->file);}
if((Parameter.GlobalConfig & FC_CFG_KOMPASS_FIX)) {sprintf(string, "<KompassFixedValue>ON!</KompassFixedValue>\r\n");fputs_(string, doc->file);}
if((Parameter.GlobalConfig & FC_CFG_DREHRATEN_BEGRENZER)) {sprintf(string, "<RotationRateLimiter>ON!</RotationRateLimiter>\r\n");fputs_(string, doc->file);}
if(!(Parameter.GlobalConfig & FC_CFG_ACHSENKOPPLUNG_AKTIV)) {sprintf(string, "<AxisCoupling>OFF!</AxisCoupling>\r\n");fputs_(string, doc->file);}
if(!(Parameter.GlobalConfig & FC_CFG_KOMPASS_AKTIV)) {sprintf(string, "<KompassActive>OFF!</KompassActive>\r\n");fputs_(string, doc->file);}
if((Parameter.GlobalConfig3 & CFG3_VARIO_FAILSAFE)) {sprintf(string, "<VarioFailsafe>On</VarioFailsafe>\r\n");fputs_(string, doc->file);}
if((Parameter.ExtraConfig & CFG_3_3V_REFERENCE)) {sprintf(string, "<3.3V_Reference>On</3.3V_Reference>\r\n");fputs_(string, doc->file);}
if((Parameter.ExtraConfig & CFG_IGNORE_MAG_ERR_AT_STARTUP)) {sprintf(string, "<IgnoreMagnetError>ON!</IgnoreMagnetError>\r\n");fputs_(string, doc->file);}
 
 
sprintf(string, "<Bytes>%02x,%02x,%02x</Bytes>\r\n",Parameter.GlobalConfig,Parameter.ExtraConfig,Parameter.GlobalConfig3);fputs_(string, doc->file);
sprintf(string, "</settings>\r\n"); fputs_(string, doc->file);
sprintf(string, "</extensions>\r\n"); fputs_(string, doc->file);
/trunk/main.c
278,16 → 278,13
else if(CheckDelay(UBX_Timeout) && Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)
{
LED_RED_ON;
// if(!(Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) sprintf(ErrorMSG,"GPS disconnected ");
// else
{
sprintf(ErrorMSG,"no GPS communication");
UART_VersionInfo.HardwareError[0] |= NC_ERROR0_GPS_RX;
UART_VersionInfo.Flags &= ~NC_VERSION_FLAG_GPS_PRESENT;
newErrorCode = 5;
}
sprintf(ErrorMSG,"no GPS communication");
UART_VersionInfo.HardwareError[0] |= NC_ERROR0_GPS_RX;
UART_VersionInfo.Flags &= ~NC_VERSION_FLAG_GPS_PRESENT;
newErrorCode = 5;
StopNavigation = 1;
// UBX_Timeout = SetDelay(500);
//UBX_Setup();
//UBX_Timeout = SetDelay(500);
}
else if(Compass_Heading < 0 && NCMAG_Present && !NCMAG_IsCalibrated)
{
565,9 → 562,9
 
Compass_Init();
 
UBX_Setup(); // inits the GPS-Module via ubx
GPS_Init();
 
 
#ifdef FOLLOW_ME
TransmitAlsoToFC = 1;
UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++");
/trunk/main.h
14,7 → 14,7
 
#define VERSION_MAJOR 2
#define VERSION_MINOR 6
#define VERSION_PATCH 6
#define VERSION_PATCH 7
// 0 = A
// 1 = B
// 2 = C
139,7 → 139,6
extern u8 NewWPL_Name;
 
#define VERSION_SERIAL_MAJOR 11 // do not change!
#define VERSION_SERIAL_MINOR 0
 
typedef struct
{
/trunk/menu.c
68,6 → 68,7
#include "ncmag.h"
#include "logging.h"
#include "settings.h"
#include "sdc.h"
 
u8 DispPtr = 0;
s8 DisplayBuff[DISPLAYBUFFSIZE];
382,8 → 383,13
break;
case 17: // User Parameter
LCD_printfxy(0,0,"SD-Card Logs");
LCD_printfxy(0,1,"GPX:%4i (%3ims) ",Logged_GPX_Counter,LogCfg.GPX_Interval);
LCD_printfxy(0,2,"KML:%4i (%3ims) ",Logged_KML_Counter,LogCfg.KML_Interval);
if(SDCardInfo.Valid == 1)
{
LCD_printfxy(0,1,"GPX:%4i (%3ims) ",Logged_GPX_Counter,LogCfg.GPX_Interval);
LCD_printfxy(0,2,"KML:%4i (%3ims) ",Logged_KML_Counter,LogCfg.KML_Interval);
}
else
LCD_printfxy(0,1,"no card in slot ");
break;
case 18: // magnetic field
if(Compass_CalState)
/trunk/spi_slave.c
766,6 → 766,7
Parameter.MaximumAltitude = FromFlightCtrl.Param.Byte[7];
FlugMinutenGesamt = FromFlightCtrl.Param.Int[4]; // 8 & 9
Parameter.CamOrientation = FromFlightCtrl.Param.Byte[10];
UART_VersionInfo.BL_Firmware = FromFlightCtrl.Param.Byte[11];
break;
 
case SPI_FCCMD_VERSION:
/trunk/uart1.c
289,10 → 289,10
UART_VersionInfo.SWMinor = VERSION_MINOR;
UART_VersionInfo.SWPatch = VERSION_PATCH;
UART_VersionInfo.ProtoMajor = VERSION_SERIAL_MAJOR;
UART_VersionInfo.ProtoMinor = VERSION_SERIAL_MINOR;
UART_VersionInfo.HWMajor = Version_HW & 0x7F;
UART_VersionInfo.reserved2 = 0;
UART_VersionInfo.BL_Firmware = 255;
UART_VersionInfo.Flags = 0;
UART_VersionInfo.Reserved1 = 0;
NaviData.Version = NAVIDATA_VERSION;
 
UART1_PutString("\r\n UART1 init...ok");
625,7 → 625,8
break;
 
case 'v': // request for version info
UART1_Request_VersionInfo = TRUE;
if(SerialMsg.DataLen > 0 && SerialMsg.pData[0] == 1) UART1_Request_VersionInfo = 1;
else UART1_Request_VersionInfo = 2;
break;
default:
// unsupported command recieved
1098,8 → 1099,24
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'L', NC_ADDRESS, 3, (u8*)&MenuItem, sizeof(MenuItem), (u8*)&MaxMenuItem, sizeof(MaxMenuItem),(u8*)DisplayBuff, sizeof(DisplayBuff));
UART1_Request_Display1 = FALSE;
}
else if(UART1_Request_VersionInfo && (UART1_tx_buffer.Locked == FALSE))
else if(UART1_Request_VersionInfo == 1 && (UART1_tx_buffer.Locked == FALSE)) // get FC-Versions
{
UART_VersionInfo_t version_tmp;
version_tmp.SWMajor = FC_Version.Major;
version_tmp.SWMinor = FC_Version.Minor;
version_tmp.SWPatch = FC_Version.Patch;
version_tmp.HWMajor = FC_Version.Hardware;
version_tmp.HardwareError[0] = 0xff; // tells the KopterTool that it is the FC-version
version_tmp.HardwareError[1] = 0xff; // tells the KopterTool that it is the FC-version
version_tmp.ProtoMajor = UART_VersionInfo.ProtoMajor;
version_tmp.BL_Firmware = UART_VersionInfo.BL_Firmware;
version_tmp.Flags = 0;
version_tmp.Reserved1 = 0;
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'V', NC_ADDRESS,1, (u8 *)&version_tmp, sizeof(version_tmp));
UART1_Request_VersionInfo = FALSE;
}
else if(UART1_Request_VersionInfo == 2 && (UART1_tx_buffer.Locked == FALSE)) // get NC-Versions
{
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'V', NC_ADDRESS,1, (u8 *)&UART_VersionInfo, sizeof(UART_VersionInfo));
UART1_Request_VersionInfo = FALSE;
}
/trunk/uart1.h
20,11 → 20,11
u8 SWMajor;
u8 SWMinor;
u8 ProtoMajor;
u8 ProtoMinor;
u8 Reserved1;
u8 SWPatch;
u8 HardwareError[2];
u8 HWMajor;
u8 reserved2;
u8 BL_Firmware;
u8 Flags;
} __attribute__((packed)) UART_VersionInfo_t;