[stock/gruvin9x] Better synchro when the mixer duration increases! Safety check on mixer interval.

This commit is contained in:
bsongis
2012-11-21 10:10:12 +00:00
parent 92a7363abc
commit efe8c2ec8c
8 changed files with 19 additions and 21 deletions
+4 -3
View File
@@ -2822,10 +2822,11 @@ void perMain()
doMixerCalculations();
#elif !defined(PCBSKY9X)
uint16_t t0 = getTmr16KHz();
int16_t delta = t0 - nextMixerTime;
if (delta < 0) return;
int16_t delta = (nextMixerEndTime - lastMixerDuration) - t0;
if (delta > 0 && delta < MAX_MIXER_DELTA) return;
nextMixerEndTime = t0 + MAX_MIXER_DELTA;
nextMixerTime = t0 + 20*16;
doMixerCalculations();
t0 = getTmr16KHz() - t0;