mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
Corrections following review
This commit is contained in:
parent
c5bb7cfd2f
commit
fa23aa6abf
2 changed files with 7 additions and 7 deletions
|
@ -59,7 +59,7 @@ typedef enum {
|
|||
TIM_USE_PWM = 0x2,
|
||||
TIM_USE_MOTOR = 0x4,
|
||||
TIM_USE_SERVO = 0x8,
|
||||
TIM_USE_LED = 0x16
|
||||
TIM_USE_LED = 0x10
|
||||
} timerUsageFlag_e;
|
||||
|
||||
// use different types from capture and overflow - multiple overflow handlers are implemented as linked list
|
||||
|
|
|
@ -245,8 +245,8 @@ void resetServoConfig(servoConfig_t *servoConfig)
|
|||
servoConfig->servoPwmRate = 50;
|
||||
|
||||
uint8_t servoIndex = 0;
|
||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && i < MAX_SUPPORTED_SERVOS; i++) {
|
||||
if ((timerHardware[i].usageFlags & TIM_USE_SERVO) == TIM_USE_SERVO) {
|
||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && servoIndex < MAX_SUPPORTED_SERVOS; i++) {
|
||||
if (timerHardware[i].usageFlags & TIM_USE_SERVO) {
|
||||
servoConfig->ioTags[servoIndex] = timerHardware[i].tag;
|
||||
servoIndex++;
|
||||
}
|
||||
|
@ -271,8 +271,8 @@ void resetMotorConfig(motorConfig_t *motorConfig)
|
|||
motorConfig->digitalIdleOffset = 40;
|
||||
|
||||
uint8_t motorIndex = 0;
|
||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && i < MAX_SUPPORTED_MOTORS; i++) {
|
||||
if ((timerHardware[i].usageFlags & TIM_USE_MOTOR) == TIM_USE_MOTOR) {
|
||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && motorIndex < MAX_SUPPORTED_MOTORS; i++) {
|
||||
if (timerHardware[i].usageFlags & TIM_USE_MOTOR) {
|
||||
motorConfig->ioTags[motorIndex] = timerHardware[i].tag;
|
||||
motorIndex++;
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ void resetPpmConfig(ppmConfig_t *ppmConfig)
|
|||
ppmConfig->ioTag = IO_TAG(PPM_PIN);
|
||||
#else
|
||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
||||
if ((timerHardware[i].usageFlags & TIM_USE_PPM) == TIM_USE_PPM) {
|
||||
if (timerHardware[i].usageFlags & TIM_USE_PPM) {
|
||||
ppmConfig->ioTag = timerHardware[i].tag;
|
||||
return;
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ void resetPwmConfig(pwmConfig_t *pwmConfig)
|
|||
{
|
||||
uint8_t inputIndex = 0;
|
||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && inputIndex < PWM_INPUT_PORT_COUNT; i++) {
|
||||
if ((timerHardware[i].usageFlags & TIM_USE_PWM) == TIM_USE_PWM) {
|
||||
if (timerHardware[i].usageFlags & TIM_USE_PWM) {
|
||||
pwmConfig->ioTags[inputIndex] = timerHardware[i].tag;
|
||||
inputIndex++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue