This commit is contained in:
3djc
2021-02-03 10:42:04 +01:00
parent 2aeb5f7ae6
commit f1e957e466
3 changed files with 20 additions and 12 deletions
+12 -8
View File
@@ -480,14 +480,16 @@ bool setupPulsesInternalModule(uint8_t protocol)
} }
} }
void stopPulsesInternalModule()
{
intmoduleStop();
moduleState[INTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE;
}
bool setupPulsesInternalModule() bool setupPulsesInternalModule()
{ {
uint8_t protocol = getRequiredProtocol(INTERNAL_MODULE); uint8_t protocol = getRequiredProtocol(INTERNAL_MODULE);
if(protocol != PROTOCOL_CHANNELS_NONE) {
INTERNAL_MODULE_ON();
}
heartbeat |= (HEART_TIMER_PULSES << INTERNAL_MODULE); heartbeat |= (HEART_TIMER_PULSES << INTERNAL_MODULE);
if (moduleState[INTERNAL_MODULE].protocol != protocol) { if (moduleState[INTERNAL_MODULE].protocol != protocol) {
@@ -502,14 +504,16 @@ bool setupPulsesInternalModule()
} }
#endif #endif
void stopPulsesExternalModule()
{
extmoduleStop();
moduleState[EXTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE;
}
bool setupPulsesExternalModule() bool setupPulsesExternalModule()
{ {
uint8_t protocol = getRequiredProtocol(EXTERNAL_MODULE); uint8_t protocol = getRequiredProtocol(EXTERNAL_MODULE);
if(protocol != PROTOCOL_CHANNELS_NONE) {
EXTERNAL_MODULE_ON();
}
heartbeat |= (HEART_TIMER_PULSES << EXTERNAL_MODULE); heartbeat |= (HEART_TIMER_PULSES << EXTERNAL_MODULE);
if (moduleState[EXTERNAL_MODULE].protocol != protocol) { if (moduleState[EXTERNAL_MODULE].protocol != protocol) {
+4
View File
@@ -315,8 +315,12 @@ extern TrainerPulsesData trainerPulsesData;
#if defined(HARDWARE_INTERNAL_MODULE) #if defined(HARDWARE_INTERNAL_MODULE)
bool setupPulsesInternalModule(); bool setupPulsesInternalModule();
void stopPulsesInternalModule();
#endif #endif
#if defined(HARDWARE_EXTERNAL_MODULE)
bool setupPulsesExternalModule(); bool setupPulsesExternalModule();
void stopPulsesExternalModule();
#endif
void setupPulsesDSM2(); void setupPulsesDSM2();
void setupPulsesCrossfire(); void setupPulsesCrossfire();
void setupPulsesGhost(); void setupPulsesGhost();
+4 -4
View File
@@ -53,11 +53,11 @@ void preModelLoad()
} }
pauseMixerCalculations(); pauseMixerCalculations();
#if defined(INTMODULE_PWR_GPIO) #if defined(HARDWARE_INTERNAL_MODULE)
INTERNAL_MODULE_OFF(); stopPulsesInternalModule();
#endif #endif
#if defined(EXTMODULE_PWR_GPIO) #if defined(HARDWARE_EXTERNAL_MODULE)
EXTERNAL_MODULE_OFF(); stopPulsesExternalModule();
#endif #endif
stopTrainer(); stopTrainer();