Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 528 → Rev 529

/trunk/main.h
14,7 → 14,7
 
#define VERSION_MAJOR 2
#define VERSION_MINOR 5
#define VERSION_PATCH 4
#define VERSION_PATCH 5
// 0 = A
// 1 = B
// 2 = C
203,6 → 203,7
} __attribute__((packed)) FC_t; // from FC
 
 
 
extern Param_t Parameter;
extern volatile FC_t FC;
extern s8 ErrorMSG[25];
223,4 → 224,9
extern u8 SpeakWaypointRached; // Speak once as soon as the Points are active
extern u8 SpeakNextWaypoint; // Speak once when reached
 
#define CHECK_ONLY 0
#define GET_LICENSE 1
#define COPY_SD_TO_EE 2
extern u8 CheckLicense(u8);
 
#endif // _MAIN_H
/trunk/uart1.c
80,8 → 80,13
#include "ftphelper.h"
#include "led.h"
#include "fat16.h"
#include "eeprom.h"
 
#define LIC_CMD_READ_LICENSE 1
#define LIC_CMD_WRITE_LICENSE 2
#define LIC_CMD_ERASE_LICENSE 3
 
 
#define FALSE 0
#define TRUE 1
 
109,6 → 114,7
u8 UART1_DisplayLine = 0;
u8 UART1_ConfirmFrame = 0;
u8 UART1_Request_FTP = FALSE;
u8 UART1_Request_LicenseString = FALSE;
u8 LastTransmittedFCStatusFlags2 = 0;
u8 UART1_ExternalControlConfirmFrame = FALSE;
u8 Send_NMEA_RMC = FALSE;
139,6 → 145,7
volatile u8 SerialLinkOkay = 0;
 
u8 text[200];
u8 *LicensePtr = UART1_tbuffer;
 
const u8 ANALOG_LABEL[32][16] =
{
159,10 → 166,10
"SPI Okay ",
"I2C Error ",
"I2C Okay ", //15
"16 dist (cm) ",
"17 alt dist ",
"18 time ",
"19 climb ", // SD-Card-time
"16 ",
"17 ",
"18 ",
"19 ", // SD-Card-time
"EarthMagnet [%] ", //20
"Ground Speed ", // "Z_Speed ",
"N_Speed ",
426,6 → 433,13
UART1_Request_SystemTime = TRUE;
break;
 
case 'm': // request for the license string
UART1_Request_LicenseString = SerialMsg.pData[0];
if(UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE)
{
memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy ftp parameter
}
break;
case 'f': // ftp command
UART1_Request_FTP = SerialMsg.pData[0];
//if (UART1_Request_FTP == FTP_CMD_SET_CWD || UART1_Request_FTP == FTP_CMD_GET_FILE)
1099,6 → 1113,40
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'E', NC_ADDRESS, 1, (u8 *)&ErrorMSG, sizeof(ErrorMSG));
UART1_Request_ErrorMessage = FALSE;
}
else if(UART1_Request_LicenseString && (UART1_tx_buffer.Locked == FALSE))
{
u8 result = 1;
if(UART1_Request_LicenseString == LIC_CMD_READ_LICENSE)
{
result = LIC_CMD_READ_LICENSE;
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))
{
result = LIC_CMD_ERASE_LICENSE;
DeleteLicenseInEEPROM();
CheckLicense(GET_LICENSE);
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))
{
result = LIC_CMD_WRITE_LICENSE;
if(CheckLicense(CHECK_ONLY)) //new license is okay
{
WriteLicenseToEEPROM(EEPROM_LICENSE_DATA_KOMPATIBEL);
result = 0;
}
else //new license is NOT okay
{
ClearLicenseText();
CheckLicense(GET_LICENSE); // fetch a license if available
}
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1);
}
UART1_Request_LicenseString = 0;
}
#ifdef FOLLOW_ME
else if(CheckDelay(UART1_FollowMe_Timer) && (UART1_tx_buffer.Locked == FALSE))
{
/trunk/uart1.h
159,7 → 159,10
extern u8 LastTransmittedFCStatusFlags2;
extern u8 UART1_Request_ReadPoint;
extern WPL_Store_t WPL_Store;
extern u8 *LicensePtr;
 
extern u32 NMEA_Interval;// in ms
#define LICENSE_SIZE 480
#define LICENSE_SIZE_TEXT 411
 
#endif //_UART1_H