1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 05:45:31 +03:00

Add and handle USE_PWM_OUTPUT

This commit is contained in:
jflyper 2018-10-09 00:30:31 +09:00
parent de1c1d5377
commit 45b7fa8095
7 changed files with 37 additions and 5 deletions

View file

@ -391,11 +391,15 @@ void init(void)
if (motorConfig()->dev.motorPwmProtocol == PWM_TYPE_BRUSHED) {
idlePulse = 0; // brushed motors
}
#ifdef USE_PWM_OUTPUT
/* Motors needs to be initialized soon as posible because hardware initialization
* may send spurious pulses to esc's causing their early initialization. Also ppm
* receiver may share timer with motors so motors MUST be initialized here. */
motorDevInit(&motorConfig()->dev, idlePulse, getMotorCount());
systemState |= SYSTEM_STATE_MOTORS_READY;
#else
UNUSED(idlePulse);
#endif
if (0) {}
#if defined(USE_PPM)
@ -776,7 +780,9 @@ void init(void)
rcdeviceInit();
#endif // USE_RCDEVICE
#ifdef USE_PWM_OUTPUT
pwmEnableMotors();
#endif
setArmingDisabled(ARMING_DISABLED_BOOT_GRACE_TIME);