mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
inverted dshot for f7
This commit is contained in:
parent
f1e9c9f19a
commit
093c2864ca
1 changed files with 4 additions and 8 deletions
|
@ -241,16 +241,12 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
||||||
const uint8_t timerIndex = getTimerIndex(timer);
|
const uint8_t timerIndex = getTimerIndex(timer);
|
||||||
const bool configureTimer = (timerIndex == dmaMotorTimerCount - 1);
|
const bool configureTimer = (timerIndex == dmaMotorTimerCount - 1);
|
||||||
|
|
||||||
uint8_t pupMode = 0;
|
uint8_t pupMode = (output & TIMER_OUTPUT_INVERTED) ? GPIO_PULLDOWN : GPIO_PULLUP;
|
||||||
#ifdef USE_DSHOT_TELEMETRY
|
#ifdef USE_DSHOT_TELEMETRY
|
||||||
if (!useDshotTelemetry) {
|
if (useDshotTelemetry) {
|
||||||
pupMode = (output & TIMER_OUTPUT_INVERTED) ? GPIO_PULLDOWN : GPIO_PULLUP;
|
output ^= TIMER_OUTPUT_INVERTED;
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
pupMode = (output & TIMER_OUTPUT_INVERTED) ? GPIO_PULLUP : GPIO_PULLDOWN;
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
IOConfigGPIOAF(motorIO, IO_CONFIG(GPIO_MODE_AF_PP, GPIO_SPEED_FREQ_VERY_HIGH, pupMode), timerHardware->alternateFunction);
|
IOConfigGPIOAF(motorIO, IO_CONFIG(GPIO_MODE_AF_PP, GPIO_SPEED_FREQ_VERY_HIGH, pupMode), timerHardware->alternateFunction);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue