From e973740b8b722e0908c941040cbb4c349589fdfc Mon Sep 17 00:00:00 2001 From: Mathieu Rondonneau Date: Wed, 28 Aug 2013 19:47:44 -0700 Subject: [PATCH] OP-1067 run uncrustify --- flight/modules/OPLink/oplinkmod.c | 61 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/flight/modules/OPLink/oplinkmod.c b/flight/modules/OPLink/oplinkmod.c index 3ddbd279f..a1a4a3442 100644 --- a/flight/modules/OPLink/oplinkmod.c +++ b/flight/modules/OPLink/oplinkmod.c @@ -150,37 +150,36 @@ static void systemTask(__attribute__((unused)) void *parameters) PIOS_RFM22B_GetStats(pios_rfm22b_id, &radio_stats); if (pios_rfm22b_id) { - // Update the status - oplinkStatus.HeapRemaining = xPortGetFreeHeapSize(); - oplinkStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id); - oplinkStatus.RxGood = radio_stats.rx_good; - oplinkStatus.RxCorrected = radio_stats.rx_corrected; - oplinkStatus.RxErrors = radio_stats.rx_error; - oplinkStatus.RxMissed = radio_stats.rx_missed; - oplinkStatus.RxFailure = radio_stats.rx_failure; - oplinkStatus.TxDropped = radio_stats.tx_dropped; - oplinkStatus.TxResent = radio_stats.tx_resent; - oplinkStatus.TxFailure = radio_stats.tx_failure; - oplinkStatus.Resets = radio_stats.resets; - oplinkStatus.Timeouts = radio_stats.timeouts; - oplinkStatus.RSSI = radio_stats.rssi; - oplinkStatus.LinkQuality = radio_stats.link_quality; - if (first_time) { - first_time = false; - } else { - uint16_t tx_count = radio_stats.tx_byte_count; - uint16_t rx_count = radio_stats.rx_byte_count; - uint16_t tx_bytes = (tx_count < prev_tx_count) ? (0xffff - prev_tx_count + tx_count) : (tx_count - prev_tx_count); - uint16_t rx_bytes = (rx_count < prev_rx_count) ? (0xffff - prev_rx_count + rx_count) : (rx_count - prev_rx_count); - oplinkStatus.TXRate = (uint16_t)((float)(tx_bytes * 1000) / SYSTEM_UPDATE_PERIOD_MS); - oplinkStatus.RXRate = (uint16_t)((float)(rx_bytes * 1000) / SYSTEM_UPDATE_PERIOD_MS); - prev_tx_count = tx_count; - prev_rx_count = rx_count; - } - oplinkStatus.TXSeq = radio_stats.tx_seq; - oplinkStatus.RXSeq = radio_stats.rx_seq; - oplinkStatus.LinkState = radio_stats.link_state; - + // Update the status + oplinkStatus.HeapRemaining = xPortGetFreeHeapSize(); + oplinkStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id); + oplinkStatus.RxGood = radio_stats.rx_good; + oplinkStatus.RxCorrected = radio_stats.rx_corrected; + oplinkStatus.RxErrors = radio_stats.rx_error; + oplinkStatus.RxMissed = radio_stats.rx_missed; + oplinkStatus.RxFailure = radio_stats.rx_failure; + oplinkStatus.TxDropped = radio_stats.tx_dropped; + oplinkStatus.TxResent = radio_stats.tx_resent; + oplinkStatus.TxFailure = radio_stats.tx_failure; + oplinkStatus.Resets = radio_stats.resets; + oplinkStatus.Timeouts = radio_stats.timeouts; + oplinkStatus.RSSI = radio_stats.rssi; + oplinkStatus.LinkQuality = radio_stats.link_quality; + if (first_time) { + first_time = false; + } else { + uint16_t tx_count = radio_stats.tx_byte_count; + uint16_t rx_count = radio_stats.rx_byte_count; + uint16_t tx_bytes = (tx_count < prev_tx_count) ? (0xffff - prev_tx_count + tx_count) : (tx_count - prev_tx_count); + uint16_t rx_bytes = (rx_count < prev_rx_count) ? (0xffff - prev_rx_count + rx_count) : (rx_count - prev_rx_count); + oplinkStatus.TXRate = (uint16_t)((float)(tx_bytes * 1000) / SYSTEM_UPDATE_PERIOD_MS); + oplinkStatus.RXRate = (uint16_t)((float)(rx_bytes * 1000) / SYSTEM_UPDATE_PERIOD_MS); + prev_tx_count = tx_count; + prev_rx_count = rx_count; + } + oplinkStatus.TXSeq = radio_stats.tx_seq; + oplinkStatus.RXSeq = radio_stats.rx_seq; + oplinkStatus.LinkState = radio_stats.link_state; } else { oplinkStatus.LinkState = OPLINKSTATUS_LINKSTATE_DISABLED; }