From caa8d3e70e3022792cded4728e46c5be70a456d6 Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Wed, 26 Jun 2013 17:47:42 -0700 Subject: [PATCH] OP-932 Forces one-way to be set when PPM only is configured. --- flight/pios/common/pios_rfm22b.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flight/pios/common/pios_rfm22b.c b/flight/pios/common/pios_rfm22b.c index 7ac514c84..cecf59e24 100644 --- a/flight/pios/common/pios_rfm22b.c +++ b/flight/pios/common/pios_rfm22b.c @@ -554,7 +554,6 @@ void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datar } ppm_mode = ppm_mode || ppm_only; rfm22b_dev->coordinator = coordinator; - rfm22b_dev->one_way_link = oneway; rfm22b_dev->ppm_send_mode = ppm_mode && coordinator; rfm22b_dev->ppm_recv_mode = ppm_mode && !coordinator; if (ppm_mode && (datarate <= RFM22B_PPM_ONLY_DATARATE)) { @@ -562,9 +561,11 @@ void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datar } rfm22b_dev->ppm_only_mode = ppm_only; if (ppm_only) { - rfm22b_dev->datarate = RFM22B_PPM_ONLY_DATARATE; + rfm22b_dev->one_way_link = true; + rfm22b_dev->datarate = RFM22B_PPM_ONLY_DATARATE; } else { - rfm22b_dev->datarate = datarate; + rfm22b_dev->one_way_link = oneway; + rfm22b_dev->datarate = datarate; } rfm22b_dev->packet_time = (ppm_mode ? packet_time_ppm[datarate] : packet_time[datarate]);