From 6e929d7a9204f9dbae828d7439567f9bab561376 Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Wed, 12 Dec 2012 20:27:08 -0700 Subject: [PATCH] Fixed configuration of PPM input. --- flight/PiOS/Common/pios_rfm22b.c | 1 - flight/PipXtreme/System/pios_board.c | 25 +++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/flight/PiOS/Common/pios_rfm22b.c b/flight/PiOS/Common/pios_rfm22b.c index ea53ac9c5..c6b101ee4 100644 --- a/flight/PiOS/Common/pios_rfm22b.c +++ b/flight/PiOS/Common/pios_rfm22b.c @@ -1500,7 +1500,6 @@ static bool rfm22_sendPPM(struct pios_rfm22b_dev *rfm22b_dev) if(rfm22b_dev->ppm_packet.channels[i - 1] != PIOS_RCVR_TIMEOUT) valid_input_detected = true; } - valid_input_detected = true; // Send the PPM packet if it's valid if (valid_input_detected) diff --git a/flight/PipXtreme/System/pios_board.c b/flight/PipXtreme/System/pios_board.c index 2cf3677ae..3467706be 100644 --- a/flight/PipXtreme/System/pios_board.c +++ b/flight/PipXtreme/System/pios_board.c @@ -197,6 +197,19 @@ void PIOS_Board_Init(void) { } #endif + /* Configure PPM input */ +#if defined(PIOS_INCLUDE_PPM) + if (oplinkSettings.PPM == OPLINKSETTINGS_PPM_TRUE) + { + uint32_t pios_ppm_id; + PIOS_PPM_Init(&pios_ppm_id, &pios_ppm_cfg); + + if (PIOS_RCVR_Init(&pios_ppm_rcvr_id, &pios_ppm_rcvr_driver, pios_ppm_id)) + PIOS_Assert(0); + } + else +#endif /* PIOS_INCLUDE_PPM */ + /* Configure the flexi serial port */ { uint32_t pios_usart3_id; @@ -214,18 +227,6 @@ void PIOS_Board_Init(void) { } } - /* Configure PPM input */ -#if defined(PIOS_INCLUDE_PPM) - if (oplinkSettings.PPM == OPLINKSETTINGS_PPM_TRUE) - { - uint32_t pios_ppm_id; - PIOS_PPM_Init(&pios_ppm_id, &pios_ppm_cfg); - - if (PIOS_RCVR_Init(&pios_ppm_rcvr_id, &pios_ppm_rcvr_driver, pios_ppm_id)) - PIOS_Assert(0); - } -#endif /* PIOS_INCLUDE_PPM */ - /* Initalize the RFM22B radio COM device. */ #if defined(PIOS_INCLUDE_RFM22B) {