mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Timer clean up in preparation for configurable timers
This commit is contained in:
parent
5e1b5df5d4
commit
aad6efdf03
19 changed files with 125 additions and 87 deletions
|
@ -39,6 +39,7 @@
|
|||
#include "drivers/pwm_output.h"
|
||||
#include "drivers/pwm_esc_detect.h"
|
||||
#include "drivers/time.h"
|
||||
#include "drivers/io.h"
|
||||
|
||||
#include "io/motors.h"
|
||||
|
||||
|
@ -103,12 +104,8 @@ void pgResetFn_motorConfig(motorConfig_t *motorConfig)
|
|||
motorConfig->dev.useBurstDshot = ENABLE_DSHOT_DMAR;
|
||||
#endif
|
||||
|
||||
int motorIndex = 0;
|
||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && motorIndex < MAX_SUPPORTED_MOTORS; i++) {
|
||||
if (timerHardware[i].usageFlags & TIM_USE_MOTOR) {
|
||||
motorConfig->dev.ioTags[motorIndex] = timerHardware[i].tag;
|
||||
motorIndex++;
|
||||
}
|
||||
for (int motorIndex = 0; motorIndex < MAX_SUPPORTED_MOTORS; motorIndex++) {
|
||||
motorConfig->dev.ioTags[motorIndex] = timerioTagGetByUsage(TIM_USE_MOTOR, motorIndex + 1);
|
||||
}
|
||||
|
||||
motorConfig->motorPoleCount = 14; // Most brushes motors that we use are 14 poles
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue