mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Fix bug where PPM rx stops working on sparky or CC3D when using motor
PWM rate > 500 (brushed motor mode). Fix is the same as for OneShot since both brushed motors and oneshot use an 8mhz timer. Fixes #58
This commit is contained in:
parent
b2f9e603df
commit
5d5fd81b2e
4 changed files with 12 additions and 4 deletions
|
@ -47,7 +47,6 @@ static pwmOutputPort_t *motors[MAX_PWM_MOTORS];
|
|||
#ifdef USE_SERVOS
|
||||
static pwmOutputPort_t *servos[MAX_PWM_SERVOS];
|
||||
#endif
|
||||
#define PWM_BRUSHED_TIMER_MHZ 8
|
||||
|
||||
static uint8_t allocatedOutputPortCount = 0;
|
||||
|
||||
|
@ -172,6 +171,11 @@ void pwmCompleteOneshotMotorUpdate(uint8_t motorCount)
|
|||
}
|
||||
}
|
||||
|
||||
bool isMotorBrushed(uint16_t motorPwmRate)
|
||||
{
|
||||
return (motorPwmRate > 500);
|
||||
}
|
||||
|
||||
void pwmBrushedMotorConfig(const timerHardware_t *timerHardware, uint8_t motorIndex, uint16_t motorPwmRate, uint16_t idlePulse)
|
||||
{
|
||||
uint32_t hz = PWM_BRUSHED_TIMER_MHZ * 1000000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue