mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-03 11:24:10 +01:00
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 69f9814c3b
.
This commit is contained in:
parent
69f9814c3b
commit
9135a1dd4f
@ -100,7 +100,7 @@ void PIOS_Servo_SetHz(const uint16_t * speeds, uint8_t banks)
|
|||||||
|
|
||||||
uint8_t set = 0;
|
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;
|
bool new = true;
|
||||||
const struct pios_tim_channel * chan = &servo_cfg->channels[i];
|
const struct pios_tim_channel * chan = &servo_cfg->channels[i];
|
||||||
|
|
||||||
@ -119,10 +119,6 @@ void PIOS_Servo_SetHz(const uint16_t * speeds, uint8_t banks)
|
|||||||
|
|
||||||
TIM_TimeBaseStructure.TIM_Period = ((1000000 / speeds[set]) - 1);
|
TIM_TimeBaseStructure.TIM_Period = ((1000000 / speeds[set]) - 1);
|
||||||
TIM_TimeBaseInit(chan->timer, &TIM_TimeBaseStructure);
|
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<banks-1)
|
|
||||||
set++;
|
set++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user