1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

STM32F4: USARTS 4,5,6 added

Flag initialisation for motor_pwm_protocol
Fixes for AlienFlightF4 and timers
This commit is contained in:
blckmn 2016-06-08 05:43:28 +10:00
parent 6bf35e09ce
commit 51a99e74c6
31 changed files with 5476 additions and 57 deletions

View file

@ -633,15 +633,21 @@ void writeServos(void)
}
#endif
void writeMotors(uint8_t fastPwmProtocol, uint8_t unsyncedPwm)
static bool syncPwm = false;
void syncMotors(bool enabled)
{
syncPwm = enabled;
}
void writeMotors(void)
{
uint8_t i;
for (i = 0; i < motorCount; i++)
pwmWriteMotor(i, motor[i]);
if (fastPwmProtocol && !unsyncedPwm) {
if (syncPwm) {
pwmCompleteOneshotMotorUpdate(motorCount);
}
}
@ -653,7 +659,7 @@ void writeAllMotors(int16_t mc)
// Sends commands to all motors
for (i = 0; i < motorCount; i++)
motor[i] = mc;
writeMotors(1,1);
writeMotors();
}
void stopMotors(void)
@ -750,7 +756,7 @@ STATIC_UNIT_TESTED void servoMixer(void)
void mixTable(void)
{
uint32_t i;
uint32_t i = 0;
fix12_t vbatCompensationFactor = 0;
static fix12_t mixReduction;
bool use_vbat_compensation = false;