/trunk/gpx.c |
---|
339,7 → 339,8 |
sprintf(string,"<ele>%ld.%03ld</ele>\r\n",i32_1, i32_2); |
fputs_(string, doc->file); |
// write <time> tag only at a resolution of one second |
sprintf(string, "<time>%04d-%02d-%02dT%02d:%02d:%02dZ</time>\r\n",SystemTime.Year, SystemTime.Month, SystemTime.Day, SystemTime.Hour, SystemTime.Min, SystemTime.Sec); |
// sprintf(string, "<time>%04d-%02d-%02dT%02d:%02d:%02dZ</time>\r\n",SystemTime.Year, SystemTime.Month, SystemTime.Day, SystemTime.Hour, SystemTime.Min, SystemTime.Sec); |
sprintf(string, "<time>%04d-%02d-%02dT%02d:%02d:%02d.%dZ</time>\r\n",SystemTime.Year, SystemTime.Month, SystemTime.Day, SystemTime.Hour, SystemTime.Min, SystemTime.Sec,SystemTime.mSec/100); |
fputs_(string, doc->file); |
// write <sat> tag |
sprintf(string, "<sat>%d</sat>\r\n", NaviData.SatsInUse); |
406,10 → 407,14 |
sprintf(string, "<MagnetInclination>%02d,%02d</MagnetInclination>\r\n",(s16)EarthMagneticInclinationFiltered/10,(s16)(EarthMagneticInclinationFiltered/10 - EarthMagneticInclinationTheoretic)); |
fputs_(string, doc->file); |
// Nick Angle ind deg |
sprintf(string, "<NickAngle>%03d</NickAngle>\r\n", NaviData.AngleNick); |
i16_1 = abs(FromFlightCtrl.AngleNick); |
if(FromFlightCtrl.AngleNick < 0) sprintf(string, "<NickAngle>-%d.%d</NickAngle>\r\n",i16_1/10,i16_1%10); |
else sprintf(string, "<NickAngle>%d.%d</NickAngle>\r\n",i16_1/10,i16_1%10); |
fputs_(string, doc->file); |
// Roll Angle in deg |
sprintf(string, "<RollAngle>%03d</RollAngle>\r\n", NaviData.AngleRoll); |
i16_1 = abs(FromFlightCtrl.AngleRoll); |
if(FromFlightCtrl.AngleRoll < 0) sprintf(string, "<RollAngle>-%d.%d</RollAngle>\r\n",i16_1/10,i16_1%10); |
else sprintf(string, "<RollAngle>%d.%d</RollAngle>\r\n",i16_1/10,i16_1%10); |
fputs_(string, doc->file); |
break; |
case 5: |
/trunk/main.c |
---|
83,7 → 83,6 |
#include "uart1.h" |
#ifdef FOLLOW_ME |
u8 TransmitAlsoToFC = 0; |
#endif |
94,7 → 93,7 |
s16 GeoMagDec = 0; // local magnetic declination in 0.1 deg |
u8 ErrorGpsFixLost = 0; |
u8 FromFC_LoadWP_List = 0, FromFC_Load_SinglePoint = 0, FromFC_Save_SinglePoint = 0; |
u8 ToFC_MaxWpListIndex = 3; |
u8 ToFC_MaxWpListIndex = 4; |
u8 ClearFCStatusFlags = 0; |
u8 StopNavigation = 0; |
volatile u32 PollingTimeout = 10000; |
107,7 → 106,6 |
u32 MaxRadius_in_m = 0; |
s8 ErrorMSG[25]; |
//---------------------------------------------------------------------------------------------------- |
void SCU_Config(void) |
{ |
/trunk/uart1.c |
---|
434,9 → 434,8 |
break; |
case 'm': // request for the license string |
if(UART_VersionInfo.HWMajor < 20) break; // this command is not supported on old Hardware -> they don't have an EEPROM |
UART1_Request_LicenseString = SerialMsg.pData[0]; |
if(UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) |
if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && (UART_VersionInfo.HWMajor >= 20)) |
{ |
memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy ftp parameter |
} |
1116,7 → 1115,7 |
} |
else if(UART1_Request_LicenseString && (UART1_tx_buffer.Locked == FALSE)) |
{ |
u8 result = 1; |
u8 result = 1, cmd = 0; |
if(UART1_Request_LicenseString == LIC_CMD_READ_LICENSE) |
{ |
result = LIC_CMD_READ_LICENSE; |
1123,7 → 1122,7 |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &result, 1, LicensePtr, LICENSE_SIZE); |
} |
else |
if((UART1_Request_LicenseString == LIC_CMD_ERASE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN)) |
if((UART1_Request_LicenseString == LIC_CMD_ERASE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN) && (UART_VersionInfo.HWMajor >= 20)) |
{ |
result = LIC_CMD_ERASE_LICENSE; |
DeleteLicenseInEEPROM(); |
1131,8 → 1130,9 |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
} |
else |
if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN)) |
if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN) && (UART_VersionInfo.HWMajor >= 20)) |
{ |
cmd = LIC_CMD_WRITE_LICENSE; |
if(CheckLicense(CHECK_ONLY)) //new license is okay |
{ |
WriteLicenseToEEPROM(EEPROM_LICENSE_DATA_KOMPATIBEL); |
1141,10 → 1141,10 |
else //new license is NOT okay |
{ |
ClearLicenseText(); |
result = CheckLicense(GET_LICENSE); // fetch a license if available |
result = 0; |
CheckLicense(GET_LICENSE); // fetch a license if available |
} |
//MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &result, 1, LicensePtr, LICENSE_SIZE); |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &cmd, 1,&result, 1 ); |
} |
UART1_Request_LicenseString = 0; |
} |