85,6 → 85,7 |
#include "triggerlog.h" |
#include "settings.h" |
#include "MobileMenu.h" |
#include "CamCtrl.h" |
|
#define LIC_CMD_READ_LICENSE 1 |
#define LIC_CMD_WRITE_LICENSE 2 |
109,6 → 110,8 |
NaviData_Out_t NaviData_Out1Trigger; |
NaviData_t NaviData; |
NaviData_HoTT_Text_t NaviData_HoTT_Text; |
WP_MissionParameter_t WP_MissionParameter; |
NaviData_Laser_t NaviData_Laser; |
|
u8 UART1_Request_VersionInfo = FALSE; |
u8 UART1_Request_ExternalControl= FALSE; |
136,6 → 139,8 |
u8 UART1_Request_MobileLabel = 0xff; |
u8 UART1_Request_MobileMenu = 0; |
u8 UART1_Request_MobileInfo = 0; |
u8 UART1_Request_MissonParameter = 0; |
u8 StopAllAbbos = 0; |
|
u8 LastTransmittedFCStatusFlags2 = 0; |
u8 UART1_ExternalControlConfirmFrame = FALSE; |
696,25 → 701,38 |
UART1_Request_WPLStore = TRUE; |
break; |
|
case 'j':// Set/Get NC-Parameter |
case 'j': |
switch(SerialMsg.pData[0]) |
{ |
case 0: // get |
case 0: // Get NC-Parameter |
UART1_Request_ParameterId = SerialMsg.pData[1]; |
UART1_Request_Parameter = TRUE; |
break; |
|
case 1: // set |
case 1: // Set NC-Parameter |
{ |
s16 value; |
value = SerialMsg.pData[2] + (s16)SerialMsg.pData[3] * 0x0100; |
NCParams_SetValue(SerialMsg.pData[1], &value); |
UART1_Request_ParameterId = SerialMsg.pData[1]; |
UART1_Request_Parameter = TRUE; |
} |
break; |
|
case 3: // Get Mission-Parameter |
UART1_Request_MissonParameter = SerialMsg.pData[0]; |
break; |
|
case 4: // Set Mission-Parameter |
memcpy(&WP_MissionParameter, &SerialMsg.pData[1], sizeof(WP_MissionParameter)); |
UART1_Request_MissonParameter = SerialMsg.pData[0]; // answer request with 4 |
break; |
case 5: // stop all abbos |
StopAllAbbos = 1; |
break; |
|
default: |
break; |
} |
UART1_Request_ParameterId = SerialMsg.pData[1]; |
UART1_Request_Parameter = TRUE; |
break; |
default: |
// unsupported command recieved |
1139,7 → 1157,18 |
|
switch(state++) |
{ |
case 0: |
case 0: if(LaserCtrlTimeout > 0) // send only, if LaserCtrl is connected |
{ |
NaviData_Laser.Index = 20; |
NaviData_Laser.ActualLongitude = NaviData.CurrentPosition.Longitude; |
NaviData_Laser.ActualLatitude = NaviData.CurrentPosition.Latitude; |
NaviData_Laser.Altimeter_5cm = NaviData.Altimeter_5cm; |
NaviData_Laser.GroundSpeed = NaviData.GroundSpeed / 10; |
NaviData_Laser.OSDStatusFlags = (FC.StatusFlags & OSD_FLAG_MASK1) | (FC.StatusFlags2 & OSD_FLAG_MASK2); |
NaviData_Laser.Distance = FromLaserCtrl.Distance; |
sent += MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'O', NC_ADDRESS, 1 , (u8 *)&NaviData_Laser, sizeof(NaviData_Laser)) + 1; |
break; |
} |
case 6: |
case 5: |
// belegt 35 ASCII-Zeichen |
1358,7 → 1387,7 |
static u8 motorindex1 = 255, motorindex2 = 0; |
if(DebugUART != UART1) return; |
|
if(CheckDelay(UART1_AboTimeOut)) |
if(CheckDelay(UART1_AboTimeOut) || StopAllAbbos) |
{ |
UART1_DebugData_Interval = 0; |
UART1_NaviData_Interval = 0; |
1370,6 → 1399,7 |
UART1_AboTimeOut = SetDelay(1000); |
UART1_MobileMenu_Timer = 0; |
TransmitNavigationData(0,1); // clear the CRC values |
StopAllAbbos = 0; |
} |
//if(UART1_NaviData_MaxBytes > 150) UART1_NaviData_MaxBytes = 150; |
//UART1_NaviData_MaxBytes = 150; |
1392,6 → 1422,11 |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'J', NC_ADDRESS, 2, &UART1_Request_ParameterId, sizeof(UART1_Request_ParameterId), &ParamValue, sizeof(ParamValue)); // answer the param request |
UART1_Request_Parameter = FALSE; |
} |
else if(UART1_Request_MissonParameter && (UART1_tx_buffer.Locked == FALSE)) |
{ |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'J', NC_ADDRESS, 2, &UART1_Request_MissonParameter, sizeof(UART1_Request_MissonParameter), &WP_MissionParameter, sizeof(WP_MissionParameter)); // answer the param request |
UART1_Request_MissonParameter = 0; |
} |
else if(UART1_Request_Echo && (UART1_tx_buffer.Locked == FALSE)) |
{ |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'Z', NC_ADDRESS, 1, &Echo, sizeof(Echo)); // answer the echo request |