1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-932: Removes requirement to ACK PPM packets.

This commit is contained in:
Brian Webb 2013-05-01 15:28:33 +01:00
parent 344e5cbb66
commit d8b09f132f

View File

@ -1917,9 +1917,9 @@ static enum pios_radio_event radio_txData(struct pios_rfm22b_dev *radio_dev)
radio_dev->time_delta = portMAX_DELAY - curTicks; radio_dev->time_delta = portMAX_DELAY - curTicks;
} }
} else if (radio_dev->tx_packet->header.type != PACKET_TYPE_NACK) { } else if ((radio_dev->tx_packet->header.type != PACKET_TYPE_NACK) && (radio_dev->tx_packet->header.type != PACKET_TYPE_PPM)) {
// We need to wait for an ACK if this packet it not an ACK or NACK. // We need to wait for an ACK if this packet it not an ACK, NACK, or PPM.
radio_dev->prev_tx_packet = radio_dev->tx_packet; radio_dev->prev_tx_packet = radio_dev->tx_packet;
radio_dev->tx_complete_ticks = xTaskGetTickCount(); radio_dev->tx_complete_ticks = xTaskGetTickCount();
} }
@ -2199,6 +2199,8 @@ static void rfm22_sendPPM(struct pios_rfm22b_dev *rfm22b_dev)
*/ */
static enum pios_radio_event rfm22_sendAck(struct pios_rfm22b_dev *rfm22b_dev) static enum pios_radio_event rfm22_sendAck(struct pios_rfm22b_dev *rfm22b_dev)
{ {
// We don't ACK PPM packets.
if (rfm22b_dev->rx_packet.header.type != PACKET_TYPE_PPM) {
PHAckNackPacketHandle aph = (PHAckNackPacketHandle)(&(rfm22b_dev->ack_nack_packet)); PHAckNackPacketHandle aph = (PHAckNackPacketHandle)(&(rfm22b_dev->ack_nack_packet));
aph->header.destination_id = rfm22b_dev->destination_id; aph->header.destination_id = rfm22b_dev->destination_id;
aph->header.type = PACKET_TYPE_ACK; aph->header.type = PACKET_TYPE_ACK;
@ -2206,6 +2208,7 @@ static enum pios_radio_event rfm22_sendAck(struct pios_rfm22b_dev *rfm22b_dev)
aph->header.seq_num = rfm22b_dev->rx_packet.header.seq_num; aph->header.seq_num = rfm22b_dev->rx_packet.header.seq_num;
aph->packet_recv_time = rfm22_coordinatorTime(rfm22b_dev, rfm22b_dev->rx_complete_ticks); aph->packet_recv_time = rfm22_coordinatorTime(rfm22b_dev, rfm22b_dev->rx_complete_ticks);
rfm22b_dev->tx_packet = (PHPacketHandle)aph; rfm22b_dev->tx_packet = (PHPacketHandle)aph;
}
return RADIO_EVENT_TX_START; return RADIO_EVENT_TX_START;
} }