Double warnings on USB disconnect
This commit is contained in:
+7
-14
@@ -1481,26 +1481,18 @@ void doMixerCalculations()
|
|||||||
s_mixer_first_run_done = true;
|
s_mixer_first_run_done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define OPENTX_START_NO_SPLASH 0x01
|
|
||||||
#define OPENTX_START_NO_CHECKS 0x02
|
|
||||||
|
|
||||||
#if !defined(OPENTX_START_DEFAULT_ARGS)
|
#if !defined(OPENTX_START_DEFAULT_ARGS)
|
||||||
#define OPENTX_START_DEFAULT_ARGS 0
|
#define OPENTX_START_DEFAULT_ARGS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void opentxStart(const uint8_t startType = OPENTX_START_DEFAULT_ARGS)
|
void opentxStart(const uint8_t startOptions = OPENTX_START_DEFAULT_ARGS)
|
||||||
{
|
{
|
||||||
TRACE("opentxStart(%u)", startType);
|
TRACE("opentxStart(%u)", startOptions);
|
||||||
|
|
||||||
if (startType & OPENTX_START_NO_CHECKS) {
|
uint8_t calibration_needed = !(startOptions & OPENTX_START_NO_CALIBRATION) && (g_eeGeneral.chkSum != evalChkSum());
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t calibration_needed = (g_eeGeneral.chkSum != evalChkSum());
|
|
||||||
|
|
||||||
#if defined(GUI)
|
#if defined(GUI)
|
||||||
if (!calibration_needed && !(startType & OPENTX_START_NO_SPLASH)) {
|
if (!calibration_needed && !(startOptions & OPENTX_START_NO_SPLASH)) {
|
||||||
doSplash();
|
doSplash();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1523,7 +1515,7 @@ void opentxStart(const uint8_t startType = OPENTX_START_DEFAULT_ARGS)
|
|||||||
if (calibration_needed) {
|
if (calibration_needed) {
|
||||||
chainMenu(menuFirstCalib);
|
chainMenu(menuFirstCalib);
|
||||||
}
|
}
|
||||||
else {
|
else if (!(startOptions & OPENTX_START_NO_CHECKS)) {
|
||||||
checkAlarm();
|
checkAlarm();
|
||||||
checkAll();
|
checkAll();
|
||||||
PLAY_MODEL_NAME();
|
PLAY_MODEL_NAME();
|
||||||
@@ -1601,7 +1593,8 @@ void opentxResume()
|
|||||||
loadFontCache();
|
loadFontCache();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
opentxStart(OPENTX_START_NO_SPLASH);
|
// removed to avoid the double warnings (throttle, switch, etc.)
|
||||||
|
// opentxStart(OPENTX_START_NO_SPLASH | OPENTX_START_NO_CALIBRATION | OPENTX_START_NO_CHECKS);
|
||||||
|
|
||||||
referenceSystemAudioFiles();
|
referenceSystemAudioFiles();
|
||||||
|
|
||||||
|
|||||||
@@ -1076,6 +1076,10 @@ void opentxClose(uint8_t shutdown=true);
|
|||||||
void opentxInit();
|
void opentxInit();
|
||||||
void opentxResume();
|
void opentxResume();
|
||||||
|
|
||||||
|
constexpr uint8_t OPENTX_START_NO_SPLASH = 0x01;
|
||||||
|
constexpr uint8_t OPENTX_START_NO_CALIBRATION = 0x02;
|
||||||
|
constexpr uint8_t OPENTX_START_NO_CHECKS = 0x04;
|
||||||
|
|
||||||
#if defined(STATUS_LEDS)
|
#if defined(STATUS_LEDS)
|
||||||
#define LED_ERROR_BEGIN() ledRed()
|
#define LED_ERROR_BEGIN() ledRed()
|
||||||
#define LED_ERROR_END() ledBlue()
|
#define LED_ERROR_END() ledBlue()
|
||||||
|
|||||||
@@ -353,15 +353,35 @@ enum ChannelsProtocols {
|
|||||||
PROTOCOL_CHANNELS_PXX2
|
PROTOCOL_CHANNELS_PXX2
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool pulsesStarted() { return moduleState[0].protocol != PROTOCOL_CHANNELS_UNINITIALIZED; }
|
inline void stopPulses()
|
||||||
inline void pausePulses() { s_pulses_paused = true; }
|
{
|
||||||
inline void resumePulses() { s_pulses_paused = false; }
|
s_pulses_paused = true;
|
||||||
|
moduleState[0].protocol = PROTOCOL_CHANNELS_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
#define SEND_FAILSAFE_NOW(idx) moduleState[idx].counter = 1
|
inline bool pulsesStarted()
|
||||||
|
{
|
||||||
|
return moduleState[0].protocol != PROTOCOL_CHANNELS_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void pausePulses()
|
||||||
|
{
|
||||||
|
s_pulses_paused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void resumePulses()
|
||||||
|
{
|
||||||
|
s_pulses_paused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void SEND_FAILSAFE_NOW(uint8_t idx)
|
||||||
|
{
|
||||||
|
moduleState[idx].counter = 1;
|
||||||
|
}
|
||||||
|
|
||||||
inline void SEND_FAILSAFE_1S()
|
inline void SEND_FAILSAFE_1S()
|
||||||
{
|
{
|
||||||
for (int i=0; i<NUM_MODULES; i++) {
|
for (uint8_t i=0; i<NUM_MODULES; i++) {
|
||||||
moduleState[i].counter = 100;
|
moduleState[i].counter = 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -370,7 +390,6 @@ inline void SEND_FAILSAFE_1S()
|
|||||||
// for channels not set previously to HOLD or NOPULSE
|
// for channels not set previously to HOLD or NOPULSE
|
||||||
void setCustomFailsafe(uint8_t moduleIndex);
|
void setCustomFailsafe(uint8_t moduleIndex);
|
||||||
|
|
||||||
|
|
||||||
enum R9MLiteLBTPowerValues {
|
enum R9MLiteLBTPowerValues {
|
||||||
R9M_LITE_LBT_POWER_25 = 0,
|
R9M_LITE_LBT_POWER_25 = 0,
|
||||||
R9M_LITE_LBT_POWER_25_16,
|
R9M_LITE_LBT_POWER_25_16,
|
||||||
|
|||||||
@@ -173,10 +173,10 @@ void StartSimu(bool tests, const char * sdPath, const char * settingsPath)
|
|||||||
if (simu_running)
|
if (simu_running)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
moduleState[0].protocol = PROTOCOL_CHANNELS_UNINITIALIZED;
|
stopPulses();
|
||||||
menuLevel = 0;
|
menuLevel = 0;
|
||||||
|
|
||||||
simu_start_mode = (tests ? 0 : 0x02 /* OPENTX_START_NO_CHECKS */);
|
simu_start_mode = (tests ? 0 : OPENTX_START_NO_SPLASH | OPENTX_START_NO_CALIBRATION | OPENTX_START_NO_CHECKS);
|
||||||
simu_shutdown = false;
|
simu_shutdown = false;
|
||||||
|
|
||||||
simuFatfsSetPaths(sdPath, settingsPath);
|
simuFatfsSetPaths(sdPath, settingsPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user