Merge pull request #8266 from opentx/3djc/fix-modelchange-module-power
Ensure module are on after model change
This commit is contained in:
@@ -480,6 +480,14 @@ bool setupPulsesInternalModule(uint8_t protocol)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void stopPulsesInternalModule()
|
||||||
|
{
|
||||||
|
if (moduleState[INTERNAL_MODULE].protocol != PROTOCOL_CHANNELS_UNINITIALIZED) {
|
||||||
|
intmoduleStop();
|
||||||
|
moduleState[INTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool setupPulsesInternalModule()
|
bool setupPulsesInternalModule()
|
||||||
{
|
{
|
||||||
uint8_t protocol = getRequiredProtocol(INTERNAL_MODULE);
|
uint8_t protocol = getRequiredProtocol(INTERNAL_MODULE);
|
||||||
@@ -498,6 +506,14 @@ bool setupPulsesInternalModule()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void stopPulsesExternalModule()
|
||||||
|
{
|
||||||
|
if (moduleState[EXTERNAL_MODULE].protocol != PROTOCOL_CHANNELS_UNINITIALIZED)) {
|
||||||
|
extmoduleStop();
|
||||||
|
moduleState[EXTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool setupPulsesExternalModule()
|
bool setupPulsesExternalModule()
|
||||||
{
|
{
|
||||||
uint8_t protocol = getRequiredProtocol(EXTERNAL_MODULE);
|
uint8_t protocol = getRequiredProtocol(EXTERNAL_MODULE);
|
||||||
|
|||||||
@@ -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();
|
||||||
@@ -353,7 +357,9 @@ inline void startPulses()
|
|||||||
setupPulsesInternalModule();
|
setupPulsesInternalModule();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HARDWARE_EXTERNAL_MODULE)
|
||||||
setupPulsesExternalModule();
|
setupPulsesExternalModule();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HARDWARE_EXTRA_MODULE)
|
#if defined(HARDWARE_EXTRA_MODULE)
|
||||||
extramodulePpmStart();
|
extramodulePpmStart();
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user