1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Uncrustified OPLink code.

This commit is contained in:
Brian Webb 2013-07-05 18:49:26 -07:00
parent 64fd0a7a6f
commit 0d02df4d02
3 changed files with 10 additions and 11 deletions

View File

@ -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;
}

View File

@ -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 */

View File

@ -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 */