From 9135a1dd4f6924913d3c5a6471d0e7e763b7e306 Mon Sep 17 00:00:00 2001 From: a*morale Date: Fri, 14 Sep 2012 22:50:13 +0200 Subject: [PATCH] They will be added the needed banks instead of defaulting to the last bank. Revert "Set all the servo timers above ACTUATORSETTINGS_CHANNELUPDATEFREQ_NUMELEM with" This reverts commit 69f9814c3b390c0893439c2147bf72758503a84c. --- flight/PiOS/STM32F4xx/pios_servo.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/flight/PiOS/STM32F4xx/pios_servo.c b/flight/PiOS/STM32F4xx/pios_servo.c index 9c664fba0..05188d563 100644 --- a/flight/PiOS/STM32F4xx/pios_servo.c +++ b/flight/PiOS/STM32F4xx/pios_servo.c @@ -100,7 +100,7 @@ void PIOS_Servo_SetHz(const uint16_t * speeds, uint8_t banks) uint8_t set = 0; - for(uint8_t i = 0; (i < servo_cfg->num_channels); i++) { + for(uint8_t i = 0; (i < servo_cfg->num_channels) && (set < banks); i++) { bool new = true; const struct pios_tim_channel * chan = &servo_cfg->channels[i]; @@ -119,11 +119,7 @@ void PIOS_Servo_SetHz(const uint16_t * speeds, uint8_t banks) TIM_TimeBaseStructure.TIM_Period = ((1000000 / speeds[set]) - 1); TIM_TimeBaseInit(chan->timer, &TIM_TimeBaseStructure); - - // don't increment as this is the last speed value provided. - // set all the remaining timers with the last speed value. - if(set