/trunk/gpx.c |
---|
130,11 → 130,7 |
tmp_license = (LicenseS_t *) LicensePtr; |
Check16File = 0x55AA; |
if(doc == NULL) return(0); |
GPX_DocumentInit(doc); // intialize the document with resetvalues |
doc->file = fopen_(name,'a'); // open a new file with the specified filename on the memorycard. |
147,7 → 143,11 |
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. |
if(OEM_String[0] == 255) |
{ |
sprintf(string, "<link href=\"http://www.mikrokopter.de\">\r\n<text>MikroKopter</text>\r\n</link>\r\n"); |
CheckSumAndWrite(&Check16File,string, doc->file); |
} |
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); |
CheckSumAndWrite(&Check16File,string, doc->file); |
if(SimulationFlags) { sprintf(string, " SIMULATED"); CheckSumAndWrite(&Check16File,string, doc->file);}; |
170,7 → 170,8 |
{ |
sprintf(string, "<name>%s</name>\r\n",tmp_license->User); CheckSumAndWrite(&Check16File,string, doc->file); |
sprintf(string, "<email>%s</email>\r\n",tmp_license->eMail); CheckSumAndWrite(&Check16File,string, doc->file); |
if(OEM_String[0] != 255) {sprintf(string, "<manufact>%s</manufact>\r\n",OEM_String); CheckSumAndWrite(&Check16File,string, doc->file);} |
if(OEM_String[0] != 255) {sprintf(string, "<manufacturer>%s</manufacturer>\r\n",OEM_String); CheckSumAndWrite(&Check16File,string, doc->file);} |
else {sprintf(string, "<manufacturer>HiSystems GmbH</manufacturer>\r\n"); CheckSumAndWrite(&Check16File,string, doc->file);} |
sprintf(string, "<features>%s</features>\r\n",tmp_license->Feature); CheckSumAndWrite(&Check16File,string, doc->file); |
sprintf(string, "<expires>%s</expires>\r\n",tmp_license->Expire);CheckSumAndWrite(&Check16File,string, doc->file); |
} |
/trunk/gpx_header.h |
---|
19,13 → 19,13 |
*/ |
const s8 GPX_DOCUMENT_HEADER1[] = |
{ |
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\r\n" |
"<?xml version=\"1.0\" encoding=\"ASCII\" standalone=\"no\" ?>\r\n" |
"<gpx creator=\"NC\" version=\"2.0\" >\r\n" |
"\r\n" |
"<metadata>\r\n" |
"<link href=\"http://www.mikrokopter.de\">\r\n" |
"<text>MikroKopter</text>\r\n" |
"</link>\r\n" |
//"<link href=\"http://www.mikrokopter.de\">\r\n" |
//"<text>MikroKopter</text>\r\n" |
//"</link>\r\n" |
}; |
const s8 GPX_DOCUMENT_METADATA_END[] = |
/trunk/kml.c |
---|
61,8 → 61,10 |
#include "uart1.h" |
#include "logging.h" |
#include "timer1.h" |
#include "main.h" |
//________________________________________________________________________________________________________________________________________ |
// Module name: kml.c |
// Compiler used: avr-gcc 3.4.5 |
133,6 → 135,8 |
retvalue = 1; // the document could be created on the drive. |
doc->state = KML_DOC_OPENED; // change document state to opened. At next a placemark has to be opened. |
fwrite_((void*)KML_DOCUMENT_HEADER1, sizeof(KML_DOCUMENT_HEADER1)-1,1,doc->file);// write the KML-header to the document. |
if(OEM_String[0] == 255) { sprintf(string, "MikroKopter "); fputs_(string, doc->file); } |
else { sprintf(string, "%s ",OEM_String); fputs_(string, doc->file); } |
sprintf(string, "%4i.%02i.%02i Nr:%i (%02i%02i%02i%02i)", SystemTime.Year, SystemTime.Month, SystemTime.Day, KML_Filenum, SystemTime.Year%100, SystemTime.Month, SystemTime.Day, KML_Filenum); |
fputs_(string, doc->file); |
fwrite_((void*)KML_DOCUMENT_HEADER2, sizeof(KML_DOCUMENT_HEADER2)-1,1,doc->file);// write the KML-header to the document. |
/trunk/kml_header.h |
---|
8,7 → 8,7 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" |
"<kml xmlns=\"http://earth.google.com/kml/2.2\">\r\n" |
"<Document>\r\n" |
"<name>MikroKopter " |
"<name>" |
}; |
const s8 KML_DOCUMENT_HEADER2[] = |
/trunk/main.c |
---|
111,8 → 111,11 |
u32 MaxWP_Radius_in_m = 0; |
s8 ErrorMSG[25]; |
s8 PartnerErrorMSG[25] = " --- \0"; |
u8 OEM_String[OEM_NAME_LENGHT+1] = {0xff,' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',0x00}; |
u32 TimeSinceMotorStart = 0; |
u8 IamMaster = NOTHING; // for Master/Slave Redundance |
u16 ToFC_Parachute_Off; |
u8 IO1_Function = 0; |
//---------------------------------------------------------------------------------------------------- |
void SCU_Config(void) |
215,6 → 218,12 |
UART_VersionInfo.HardwareError[0] |= NC_ERROR0_FC_INCOMPATIBLE; |
DebugOut.StatusRed |= AMPEL_NC; |
} |
else if(ToFC_Parachute_Off) |
{ |
LED_RED_ON; |
sprintf(ErrorMSG,"ERR: PARACHUTE"); |
newErrorCode = 43; |
} |
else if(FC.Error[0] & FC_ERROR0_GYRO_NICK) |
{ |
LED_RED_ON; |
513,6 → 522,22 |
GPS_Navigation(&GPSData, &(ToFlightCtrl.GPSStick)); // process the GPS data even if the FC is not connected |
TimeoutGPS_Process = 0; |
} |
if(UART_VersionInfo.HWMajor >= 30) |
{ |
switch(IO1_Function) |
{ |
case IO1FUNC_PARACHUTE: // parachute |
if(IO1_INPUT == 0) |
{ |
if(ToFC_Parachute_Off < 2000) ToFC_Parachute_Off++; |
} |
else ToFC_Parachute_Off = 0; |
break; |
default: ToFC_Parachute_Off = 0; |
break; // no function |
} |
} |
} |
SPI0_UpdateBuffer(); // also calls the GPS-functions |
533,6 → 558,7 |
{ |
memcpy(&EE_Parameter, (u8 *) HugeBlockFromFC.Data, sizeof(EE_Parameter)); |
RequestConfigFromFC = 0; |
if(UART_VersionInfo.HWMajor >= 30) SendOemName = 1; |
} |
HugeBlockFromFC.WhoAmI = 0; |
} |
687,7 → 713,7 |
LED_RED_ON; |
} |
#endif |
if(UBX_Setup() == 0) UBX_Setup(); // inits the GPS-Module via ubx -> try twice |
if(UBX_Setup() == 0) UBX_Setup(); // inits the GPS-Module via ubx -> try twice // Achtung: muss nach FC-Versions check |
// +++++++++++++++++++++++++++++++++++++++ |
// ++ check CamCtrl version (if connected) |
if(Compass_I2CPort == NCMAG_PORT_INTERN) |
/trunk/main.h |
---|
13,8 → 13,8 |
//----------------------- |
#define VERSION_MAJOR 2 |
#define VERSION_MINOR 14 |
#define VERSION_PATCH 3 |
#define VERSION_MINOR 15 |
#define VERSION_PATCH 2 |
// 0 = A |
// 1 = B |
// 2 = C |
37,7 → 37,7 |
#define CAN_SLAVE_COMPATIBLE 1 |
#ifndef FOLLOW_ME |
#define FC_SPI_COMPATIBLE 81 // <------------------ |
#define FC_SPI_COMPATIBLE 83 // <------------------ |
#else |
#define FC_SPI_COMPATIBLE 0xFF |
#endif |
86,6 → 86,9 |
#define NC_FLAG_MANUAL_CONTROL 0x40 |
#define NC_FLAG_GPS_OK 0x80 |
//IO1_Function |
#define IO1FUNC_PARACHUTE 9 |
#define IO1FUNC_ERROR_PARACHUTE 255 |
// NC calculates |
//OSDStatusFlags = (FC.StatusFlags & OSD_FLAG_MASK1) | (FC.StatusFlags2 & OSD_FLAG_MASK2); |
134,10 → 137,13 |
//Parameter.GlobalConfig3 |
#define CFG3_NO_SDCARD_NO_START 0x01 |
//#define CFG3_DPH_MAX_RADIUS 0x02 |
#define CFG3_RISE_FIRST_WAYPOINT 0x02 |
#define CFG3_VARIO_FAILSAFE 0x04 |
#define CFG3_MOTOR_SWITCH_MODE 0x08 |
#define CFG3_NO_GPSFIX_NO_START 0x10 |
#define CFG3_USE_NC_FOR_OUT1 0x20 |
#define CFG3_SPEAK_ALL 0x40 |
#define CFG3_SERVO_NICK_COMP_OFF 0x80 |
// Parameter.GlobalConfig |
#define FC_CFG_HOEHENREGELUNG 0x01 |
324,9 → 330,12 |
extern s16 CompassSetpointCorrected; // The compass setpoint that the FC tries to keep - corrected with the magnetic declination |
extern s16 CompassSetpoint; |
extern u8 AmountOfMotors; |
extern s16 SimulatedDirection; // simulated compass direction |
extern s16 SimulatedDirection; // simulated compass direction |
extern u16 ToFC_Parachute_Off; // forced Switch off via IO1 |
extern u8 IO1_Function; |
#define OEM_NAME_LENGHT 16 |
extern u8 OEM_String[OEM_NAME_LENGHT+1]; |
#define CHECK_ONLY 0 |
#define GET_LICENSE 1 |
#define COPY_SD_TO_EE 2 |
343,5 → 352,6 |
#define TRIGGER_PP_INTERN PIN6_0 |
#define TRIGGER_PP_EXTERN PIN6_3 |
#define BLITZ_CONNECTED PIN6_4 |
#define IO1_INPUT PIN6_5 |
#endif // _MAIN_H |
/trunk/settings.c |
---|
217,7 → 217,7 |
return; |
} |
// run thrue all parameters and set value to default |
fputs_("######## MikroKopter configuration file ########\r\n", fp); // write to file |
fputs_("######## NaviControl configuration file ########\r\n", fp); // write to file |
fputs_("#------------------------------------------------------\r\n\r\n", fp); // write to file |
for (i = 0; i < sizeof(CFG_Parameter) / sizeof(Parameter_t); i++) |
{ |