1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 19:40:20 +03:00

start mixer scheduler once internal module is turned off

This commit is contained in:
Raphael Coeffic 2019-11-09 18:42:36 +01:00 committed by 3djc
parent 96dc07ad16
commit a4ac99252b
2 changed files with 3 additions and 0 deletions

View file

@ -352,6 +352,7 @@ static void enablePulsesInternalModule(uint8_t protocol)
break; break;
#endif #endif
default: default:
mixerSchedulerStart();
break; break;
} }
} }

View file

@ -62,6 +62,8 @@ void mixerSchedulerSetPeriod(uint8_t moduleIdx, uint16_t periodUs)
// Start scheduler with default period // Start scheduler with default period
void mixerSchedulerStart() void mixerSchedulerStart()
{ {
MIXER_SCHEDULER_TIMER->CR1 &= ~TIM_CR1_CEN;
MIXER_SCHEDULER_TIMER->CR1 = TIM_CR1_URS; // do not generate interrupt on soft update MIXER_SCHEDULER_TIMER->CR1 = TIM_CR1_URS; // do not generate interrupt on soft update
MIXER_SCHEDULER_TIMER->PSC = MIXER_SCHEDULER_TIMER_FREQ / 2000000 - 1; // 0.5uS (2Mhz) MIXER_SCHEDULER_TIMER->PSC = MIXER_SCHEDULER_TIMER_FREQ / 2000000 - 1; // 0.5uS (2Mhz)
MIXER_SCHEDULER_TIMER->CCER = 0; MIXER_SCHEDULER_TIMER->CCER = 0;