Merge pull request #8480 from AlessandroAU/move-adcRead()-to-mixer-ISR

Move adcRead() to mixer scheduler IRQ to reduce sample jitter
This commit is contained in:
Raphael Coeffic
2021-05-03 14:45:27 +02:00
committed by GitHub
2 changed files with 5 additions and 4 deletions
-4
View File
@@ -1101,10 +1101,6 @@ void getADC()
}
#endif
DEBUG_TIMER_START(debugTimerAdcRead);
adcRead();
DEBUG_TIMER_STOP(debugTimerAdcRead);
for (uint8_t x=0; x<NUM_ANALOGS; x++) {
uint16_t v;
@@ -74,6 +74,11 @@ extern "C" void MIXER_SCHEDULER_TIMER_IRQHandler(void)
// set next period
MIXER_SCHEDULER_TIMER->ARR = 2 * getMixerSchedulerPeriod() - 1;
//read ADCs
DEBUG_TIMER_START(debugTimerAdcRead);
adcRead();
DEBUG_TIMER_STOP(debugTimerAdcRead);
// trigger mixer start
mixerSchedulerISRTrigger();
}