mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Merge pull request #1327 from blckmn/ppm_pin_selection
Fixed up PPM allocation
This commit is contained in:
commit
aac888e3c0
1 changed files with 8 additions and 1 deletions
|
@ -308,6 +308,13 @@ void resetPpmConfig(ppmConfig_t *ppmConfig)
|
||||||
#ifdef PPM_PIN
|
#ifdef PPM_PIN
|
||||||
ppmConfig->ioTag = IO_TAG(PPM_PIN);
|
ppmConfig->ioTag = IO_TAG(PPM_PIN);
|
||||||
#else
|
#else
|
||||||
|
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
||||||
|
if ((timerHardware[i].output == TIMER_INPUT_ENABLED)) {
|
||||||
|
ppmConfig->ioTag = timerHardware[i].tag;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ppmConfig->ioTag = IO_TAG_NONE;
|
ppmConfig->ioTag = IO_TAG_NONE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -315,7 +322,7 @@ void resetPpmConfig(ppmConfig_t *ppmConfig)
|
||||||
void resetPwmConfig(pwmConfig_t *pwmConfig)
|
void resetPwmConfig(pwmConfig_t *pwmConfig)
|
||||||
{
|
{
|
||||||
uint8_t inputIndex = 0;
|
uint8_t inputIndex = 0;
|
||||||
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && i < PWM_INPUT_PORT_COUNT; i++) {
|
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT && inputIndex < PWM_INPUT_PORT_COUNT; i++) {
|
||||||
if ((timerHardware[i].output == TIMER_INPUT_ENABLED)) {
|
if ((timerHardware[i].output == TIMER_INPUT_ENABLED)) {
|
||||||
pwmConfig->ioTags[inputIndex] = timerHardware[i].tag;
|
pwmConfig->ioTags[inputIndex] = timerHardware[i].tag;
|
||||||
inputIndex++;
|
inputIndex++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue