From 0d02df4d02354de4098f086cc00aa2ad3551c017 Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Fri, 5 Jul 2013 18:49:26 -0700 Subject: [PATCH] Uncrustified OPLink code. --- flight/pios/common/pios_rfm22b.c | 2 +- flight/targets/boards/oplinkmini/board_hw_defs.c | 6 +++--- .../targets/boards/oplinkmini/firmware/pios_board.c | 13 ++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/flight/pios/common/pios_rfm22b.c b/flight/pios/common/pios_rfm22b.c index 09b8907fe..c663da70d 100644 --- a/flight/pios/common/pios_rfm22b.c +++ b/flight/pios/common/pios_rfm22b.c @@ -1909,7 +1909,7 @@ static enum pios_radio_event radio_receivePacket(struct pios_rfm22b_dev *radio_d // Is this a valid channel? if (p[0] & (1 << i)) { uint32_t val = p[i + 1]; - radio_dev->ppm[i] = (uint16_t)(1000 + val * 900 / 256); + radio_dev->ppm[i] = (uint16_t)(1000 + val * 900 / 256); } else { radio_dev->ppm[i] = PIOS_RCVR_INVALID; } diff --git a/flight/targets/boards/oplinkmini/board_hw_defs.c b/flight/targets/boards/oplinkmini/board_hw_defs.c index 6bb023d18..cd106914a 100644 --- a/flight/targets/boards/oplinkmini/board_hw_defs.c +++ b/flight/targets/boards/oplinkmini/board_hw_defs.c @@ -491,7 +491,7 @@ static const struct pios_tim_channel pios_tim_all_port_pins[] = { static const struct pios_tim_channel pios_tim_main_port_ppm = { .timer = TIM1, - .timer_chan = TIM_Channel_3, + .timer_chan = TIM_Channel_3, .pin = { .gpio = GPIOA, .init = { @@ -504,7 +504,7 @@ static const struct pios_tim_channel pios_tim_main_port_ppm = { static const struct pios_tim_channel pios_tim_flexi_port_ppm = { .timer = TIM2, - .timer_chan = TIM_Channel_4, + .timer_chan = TIM_Channel_4, .pin = { .gpio = GPIOB, .init = { @@ -513,7 +513,7 @@ static const struct pios_tim_channel pios_tim_flexi_port_ppm = { .GPIO_Speed = GPIO_Speed_2MHz, }, }, - .remap = GPIO_PartialRemap2_TIM2, + .remap = GPIO_PartialRemap2_TIM2, }; #endif /* PIOS_INCLUDE_TIM */ diff --git a/flight/targets/boards/oplinkmini/firmware/pios_board.c b/flight/targets/boards/oplinkmini/firmware/pios_board.c index f5921a37f..5c429d57e 100644 --- a/flight/targets/boards/oplinkmini/firmware/pios_board.c +++ b/flight/targets/boards/oplinkmini/firmware/pios_board.c @@ -222,10 +222,10 @@ void PIOS_Board_Init(void) OPLinkSettingsData oplinkSettings; OPLinkSettingsGet(&oplinkSettings); bool is_coordinator = (oplinkSettings.Coordinator == OPLINKSETTINGS_COORDINATOR_TRUE); - bool is_oneway = (oplinkSettings.OneWay == OPLINKSETTINGS_ONEWAY_TRUE); - bool ppm_only = (oplinkSettings.PPMOnly == OPLINKSETTINGS_PPMONLY_TRUE); - bool ppm_mode = false; - bool servo_main = false; + bool is_oneway = (oplinkSettings.OneWay == OPLINKSETTINGS_ONEWAY_TRUE); + bool ppm_only = (oplinkSettings.PPMOnly == OPLINKSETTINGS_PPMONLY_TRUE); + bool ppm_mode = false; + bool servo_main = false; bool servo_flexi = false; switch (oplinkSettings.MainPort) { case OPLINKSETTINGS_MAINPORT_TELEMETRY: @@ -255,7 +255,7 @@ void PIOS_Board_Init(void) if (is_coordinator) { uint32_t pios_ppm_id; PIOS_PPM_Init(&pios_ppm_id, &pios_ppm_main_cfg); - + if (PIOS_RCVR_Init(&pios_ppm_rcvr_id, &pios_ppm_rcvr_driver, pios_ppm_id)) { PIOS_Assert(0); } @@ -309,8 +309,7 @@ void PIOS_Board_Init(void) if (PIOS_RCVR_Init(&pios_ppm_rcvr_id, &pios_ppm_rcvr_driver, pios_ppm_id)) { PIOS_Assert(0); } - } - else { + } else { PIOS_PPM_Out_Init(&pios_ppm_out_id, &pios_flexi_ppm_out_cfg); } #endif /* PIOS_INCLUDE_PPM */