mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Tightening up code inside atomic block, and whitespace changes (tabs to spaces)
This commit is contained in:
parent
8a9e51c779
commit
895d215265
3 changed files with 40 additions and 40 deletions
|
@ -178,7 +178,6 @@ void pwmBrushedMotorConfig(const timerHardware_t *timerHardware, uint8_t motorIn
|
|||
uint32_t hz = PWM_BRUSHED_TIMER_MHZ * 1000000;
|
||||
motors[motorIndex] = pwmOutConfig(timerHardware, PWM_BRUSHED_TIMER_MHZ, hz / motorPwmRate, idlePulse);
|
||||
motors[motorIndex]->pwmWritePtr = pwmWriteBrushed;
|
||||
|
||||
}
|
||||
|
||||
void pwmBrushlessMotorConfig(const timerHardware_t *timerHardware, uint8_t motorIndex, uint16_t motorPwmRate, uint16_t idlePulse)
|
||||
|
|
|
@ -806,9 +806,10 @@ void timerStart(void)
|
|||
**/
|
||||
void timerForceOverflow(volatile TIM_TypeDef *tim)
|
||||
{
|
||||
uint8_t timerIndex = lookupTimerIndex((const TIM_TypeDef *)tim);
|
||||
|
||||
ATOMIC_BLOCK(NVIC_PRIO_TIMER) {
|
||||
// Save the current count so that PPM reading will work on the same timer that was forced to overflow
|
||||
uint8_t timerIndex = lookupTimerIndex((const TIM_TypeDef *)tim);
|
||||
timerConfig[timerIndex].forcedOverflowTimerValue = tim->CNT + 1;
|
||||
|
||||
// Force an overflow by setting the UG bit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue