1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-02 19:29:15 +01:00

OP-932 Fixes raw serial on UART and USB VCP.

This commit is contained in:
Brian Webb 2013-06-27 19:16:01 -07:00
parent d5f16faaec
commit 6386b12026

View File

@ -326,10 +326,15 @@ static void radioRxTask(__attribute__((unused)) void *parameters)
uint8_t serial_data[1]; uint8_t serial_data[1];
uint16_t bytes_to_process = PIOS_COM_ReceiveBuffer(PIOS_COM_RADIO, serial_data, sizeof(serial_data), MAX_PORT_DELAY); uint16_t bytes_to_process = PIOS_COM_ReceiveBuffer(PIOS_COM_RADIO, serial_data, sizeof(serial_data), MAX_PORT_DELAY);
if (bytes_to_process > 0) { if (bytes_to_process > 0) {
if (data->parseUAVTalk) {
// Pass the data through the UAVTalk parser. // Pass the data through the UAVTalk parser.
for (uint8_t i = 0; i < bytes_to_process; i++) { for (uint8_t i = 0; i < bytes_to_process; i++) {
ProcessRadioStream(data->radioUAVTalkCon, data->telemUAVTalkCon, serial_data[i]); ProcessRadioStream(data->radioUAVTalkCon, data->telemUAVTalkCon, serial_data[i]);
} }
} else if (PIOS_COM_TELEMETRY) {
// Send the data straight to the telemetry port.
PIOS_COM_SendBufferNonBlocking(PIOS_COM_TELEMETRY, serial_data, bytes_to_process);
}
} }
} else { } else {
vTaskDelay(5); vTaskDelay(5);
@ -465,6 +470,9 @@ static int32_t UAVTalkSendHandler(uint8_t *buf, int32_t length)
*/ */
static int32_t RadioSendHandler(uint8_t *buf, int32_t length) static int32_t RadioSendHandler(uint8_t *buf, int32_t length)
{ {
if (!data->parseUAVTalk) {
return length;
}
uint32_t outputPort = PIOS_COM_RADIO; uint32_t outputPort = PIOS_COM_RADIO;
// Don't send any data unless the radio port is available. // Don't send any data unless the radio port is available.