Some cleanup
This commit is contained in:
@@ -139,13 +139,7 @@ TASK_FUNCTION(mixerTask)
|
|||||||
s_pulses_paused = true;
|
s_pulses_paused = true;
|
||||||
|
|
||||||
mixerSchedulerInit();
|
mixerSchedulerInit();
|
||||||
|
|
||||||
#if !defined(PCBSKY9X)
|
|
||||||
mixerSchedulerStart();
|
mixerSchedulerStart();
|
||||||
#endif
|
|
||||||
|
|
||||||
// clear the flag before first loop
|
|
||||||
//mixerSchedulerClearTrigger();
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int timeout = 0;
|
int timeout = 0;
|
||||||
@@ -166,13 +160,8 @@ TASK_FUNCTION(mixerTask)
|
|||||||
GPIO_ResetBits(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PIN);
|
GPIO_ResetBits(EXTMODULE_TX_GPIO, EXTMODULE_TX_GPIO_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(PCBSKY9X)
|
|
||||||
// clear the flag ASAP to avoid missing a tick
|
|
||||||
//mixerSchedulerClearTrigger();
|
|
||||||
|
|
||||||
// re-enable trigger
|
// re-enable trigger
|
||||||
mixerSchedulerEnableTrigger();
|
mixerSchedulerEnableTrigger();
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SIMU)
|
#if defined(SIMU)
|
||||||
if (pwrCheck() == e_power_off) {
|
if (pwrCheck() == e_power_off) {
|
||||||
@@ -191,13 +180,7 @@ TASK_FUNCTION(mixerTask)
|
|||||||
RTOS_LOCK_MUTEX(mixerMutex);
|
RTOS_LOCK_MUTEX(mixerMutex);
|
||||||
|
|
||||||
doMixerCalculations();
|
doMixerCalculations();
|
||||||
|
|
||||||
#if defined(PCBSKY9X)
|
|
||||||
sendSynchronousPulses(1 << EXTERNAL_MODULE);
|
|
||||||
#else
|
|
||||||
sendSynchronousPulses((1 << INTERNAL_MODULE) | (1 << EXTERNAL_MODULE));
|
sendSynchronousPulses((1 << INTERNAL_MODULE) | (1 << EXTERNAL_MODULE));
|
||||||
#endif
|
|
||||||
|
|
||||||
doMixerPeriodicUpdates();
|
doMixerPeriodicUpdates();
|
||||||
|
|
||||||
DEBUG_TIMER_START(debugTimerMixerCalcToUsage);
|
DEBUG_TIMER_START(debugTimerMixerCalcToUsage);
|
||||||
@@ -211,10 +194,6 @@ TASK_FUNCTION(mixerTask)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBSKY9X) && !defined(SIMU)
|
|
||||||
usbJoystickUpdate();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (heartbeat == HEART_WDT_CHECK) {
|
if (heartbeat == HEART_WDT_CHECK) {
|
||||||
WDG_RESET();
|
WDG_RESET();
|
||||||
heartbeat = 0;
|
heartbeat = 0;
|
||||||
@@ -223,10 +202,6 @@ TASK_FUNCTION(mixerTask)
|
|||||||
t0 = getTmr2MHz() - t0;
|
t0 = getTmr2MHz() - t0;
|
||||||
if (t0 > maxMixerDuration)
|
if (t0 > maxMixerDuration)
|
||||||
maxMixerDuration = t0;
|
maxMixerDuration = t0;
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// - check the cause of timeouts when switching
|
|
||||||
// between protocols with multi-proto RF
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user