mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Fixed processing of UAVTalk packets when in transparent com mode.
This commit is contained in:
parent
14bbd09c87
commit
6fbc3339d5
@ -291,7 +291,7 @@ static void comUAVTalkTask(void *parameters)
|
||||
data->txBytes++;
|
||||
|
||||
// Get a TX packet from the packet handler if required.
|
||||
if (p == NULL)
|
||||
if ((p == NULL) && !PIOS_COM_TRANS_COM)
|
||||
{
|
||||
|
||||
// Wait until we receive a sync.
|
||||
@ -320,6 +320,7 @@ static void comUAVTalkTask(void *parameters)
|
||||
}
|
||||
|
||||
// Insert this byte.
|
||||
if(p)
|
||||
p->data[p->header.data_size++] = rx_byte;
|
||||
|
||||
// Keep reading until we receive a completed packet.
|
||||
@ -390,11 +391,13 @@ static void comUAVTalkTask(void *parameters)
|
||||
}
|
||||
|
||||
// Release the packet, since we don't need it.
|
||||
if(p)
|
||||
PHReleaseTXPacket(pios_packet_handler, p);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, queue the packet for transmission.
|
||||
// Otherwise, queue the packet for transmission if we're using UAVTalk comms.
|
||||
if(p)
|
||||
xQueueSend(data->sendPacketQueue, &p, MAX_PORT_DELAY);
|
||||
}
|
||||
}
|
||||
@ -425,12 +428,14 @@ static void comUAVTalkTask(void *parameters)
|
||||
}
|
||||
|
||||
// Release the packet, since we don't need it.
|
||||
if(p)
|
||||
PHReleaseTXPacket(pios_packet_handler, p);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Queue the packet for transmission.
|
||||
// Queue the packet for transmission if we're using UAVTalk comms.
|
||||
if(p)
|
||||
xQueueSend(data->sendPacketQueue, &p, MAX_PORT_DELAY);
|
||||
}
|
||||
p = NULL;
|
||||
@ -449,11 +454,13 @@ static void comUAVTalkTask(void *parameters)
|
||||
xQueueSend(data->objEventQueue, &ev, MAX_PORT_DELAY);
|
||||
|
||||
// Release the packet and start over again.
|
||||
if(p)
|
||||
PHReleaseTXPacket(pios_packet_handler, p);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transmit the packet anyway...
|
||||
if(p)
|
||||
xQueueSend(data->sendPacketQueue, &p, MAX_PORT_DELAY);
|
||||
}
|
||||
p = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user