126,11 → 126,16 |
u8 UART1_ConfirmFrame = 0; |
u8 UART1_Request_FTP = FALSE; |
u8 UART1_Request_LicenseString = FALSE; |
u8 UART1_Request_PPM_Channels = FALSE; |
u8 LastTransmittedFCStatusFlags2 = 0; |
u8 UART1_ExternalControlConfirmFrame = FALSE; |
u8 Send_NMEA_RMC = FALSE; |
u8 NaviData_Flags_SpeakHoTT_Processed = 0; |
u8 NewExternalControlFrame = 0; // flag that sends the Frame to FC |
|
SerialChannel_t SerialChannel; |
u8 NewSerialChannelFrame = 0; // flag that sends the Frame to FC |
|
UART_TypeDef *DebugUART = UART1; |
|
#ifdef FOLLOW_ME |
325,6 → 330,11 |
UART_VersionInfo.Flags = 0; |
UART_VersionInfo.LabelTextCRC = CalculateDebugLableCrc(); |
NaviData.Version = NAVIDATA_VERSION; |
|
PPM_In[PPM_IN_MAX] = +127; |
PPM_In[PPM_IN_OFF] = -127; |
PPM_In[PPM_IN_MID] = 0; |
|
UART1_PutString("\r\n UART1 init...ok"); |
} |
|
438,21 → 448,21 |
|
// analyze header first |
MKProtocol_DecodeSerialFrameHeader(&UART1_rx_buffer, &SerialMsg); |
/* |
if( SerialMsg.Address == FC_ADDRESS ) |
{ |
switch(SerialMsg.CmdID) |
{ |
// case 'v': // version |
case 'b': // extern control |
UART1_ExternalControlConfirmFrame = 1; |
case 'y': // serial poti values |
Buffer_Copy(&UART1_rx_buffer, &UART2_tx_buffer); //forward to FC |
Buffer_Clear(&UART1_rx_buffer); // free rc buffer for next frame |
return; //end process rx data |
// case 'b': // extern control |
// UART1_ExternalControlConfirmFrame = 1; |
// case 'y': // serial poti values |
// Buffer_Copy(&UART1_rx_buffer, &UART2_tx_buffer); //forward to FC |
// Buffer_Clear(&UART1_rx_buffer); // free rc buffer for next frame |
// return; //end process rx data |
break; |
} |
} |
|
*/ |
MKProtocol_DecodeSerialFrameData(&UART1_rx_buffer, &SerialMsg); // decode serial frame in rxd buffer |
if(SerialMsg.CmdID != 'z') SerialLinkOkay = 250; // reset SerialTimeout, but not in case of the "ping" |
switch(SerialMsg.Address) // check for Slave Address |
635,12 → 645,27 |
UART1_Request_DebugLabel = SerialMsg.pData[0]; |
if(UART1_Request_DebugLabel > 31) UART1_Request_DebugLabel = 31; |
break; |
/* |
|
case 'b': // submit extern control |
memcpy(&ExternControl, SerialMsg.pData, sizeof(ExternControl)); |
UART1_ConfirmFrame = ExternControl.Frame; |
NewExternalControlFrame = 1; |
break; |
*/ |
|
case 'y': // serial Channels |
memcpy(&SerialChannel, SerialMsg.pData, sizeof(SerialChannel)); |
memcpy((u8 *) &(PPM_In[SERIAL_POTI_START]), (u8 *) &SerialChannel, 12); // copy the 12 Bytes Serial Channels into the PPM_In array |
NewSerialChannelFrame = 1; |
break; |
|
case 'g':// request for the externalControl |
UART1_Request_ExternalControl = TRUE; |
break; |
|
case 'p':// request for the PPM_In |
UART1_Request_PPM_Channels = TRUE; |
break; |
|
case 'd': // request for debug data; |
UART1_DebugData_Interval = (u32) SerialMsg.pData[0] * 10; |
if(UART1_DebugData_Interval > 0) UART1_Request_DebugData = TRUE; |
1376,21 → 1401,16 |
CreateNmeaRMC(); |
Send_NMEA_RMC = FALSE; |
} |
|
/* |
else if(UART1_ConfirmFrame && (UART1_tx_buffer.Locked == FALSE)) |
{ |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'B', NC_ADDRESS, 1, &UART1_ConfirmFrame, sizeof(UART1_ConfirmFrame)); |
UART1_ConfirmFrame = 0; |
} |
*/ |
/* |
else if(UART1_Request_ExternalControl && (UART1_tx_buffer.Locked == FALSE)) |
{ |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'G', NC_ADDRESS, 1, (u8 *)&ExternControl, sizeof(ExternControl)); |
UART1_Request_ExternalControl = FALSE; |
} |
*/ |
else if( (( (UART1_Display_Interval > 0) && CheckDelay(UART1_Display_Timer)) || UART1_Request_Display) && (UART1_tx_buffer.Locked == FALSE)) |
{ |
if(UART1_DisplayLine > 3) |
1446,6 → 1466,11 |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'E', NC_ADDRESS, 1, (u8 *)&ErrorMSG, sizeof(ErrorMSG)); |
UART1_Request_ErrorMessage = FALSE; |
} |
else if(UART1_Request_PPM_Channels && (UART1_tx_buffer.Locked == FALSE)) |
{ |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'P', NC_ADDRESS, 1, (u8 *)&PPM_In, sizeof(PPM_In)); |
UART1_Request_PPM_Channels = FALSE; |
} |
else if(UART1_Request_LicenseString && (UART1_tx_buffer.Locked == FALSE)) |
{ |
u8 result = 1, cmd = 0; |