MODULE_ALWAYS_SEND_PULSES define removed
This commit is contained in:
@@ -32,9 +32,6 @@ SwOn swOn [MAX_MIXERS]; // TODO better name later...
|
|||||||
|
|
||||||
uint8_t mixWarning;
|
uint8_t mixWarning;
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
uint8_t startupWarningState;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int16_t calibratedAnalogs[NUM_CALIBRATED_ANALOGS];
|
int16_t calibratedAnalogs[NUM_CALIBRATED_ANALOGS];
|
||||||
int16_t channelOutputs[MAX_OUTPUT_CHANNELS] = {0};
|
int16_t channelOutputs[MAX_OUTPUT_CHANNELS] = {0};
|
||||||
@@ -560,9 +557,6 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
|
|||||||
|
|
||||||
if (tick10ms) evalLogicalSwitches(mode==e_perout_mode_normal);
|
if (tick10ms) evalLogicalSwitches(mode==e_perout_mode_normal);
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
checkStartupWarnings();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HELI)
|
#if defined(HELI)
|
||||||
int heliEleValue = getValue(g_model.swashR.elevatorSource);
|
int heliEleValue = getValue(g_model.swashR.elevatorSource);
|
||||||
|
|||||||
@@ -905,15 +905,11 @@ void checkAll()
|
|||||||
checkLowEEPROM();
|
checkLowEEPROM();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
startupWarningState = STARTUP_WARNING_THROTTLE;
|
|
||||||
#else
|
|
||||||
if (g_eeGeneral.chkSum == evalChkSum()) {
|
if (g_eeGeneral.chkSum == evalChkSum()) {
|
||||||
checkTHR();
|
checkTHR();
|
||||||
}
|
}
|
||||||
checkSwitches();
|
checkSwitches();
|
||||||
checkFailsafe();
|
checkFailsafe();
|
||||||
#endif
|
|
||||||
checkRSSIAlarmsDisabled();
|
checkRSSIAlarmsDisabled();
|
||||||
|
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
@@ -941,17 +937,6 @@ void checkAll()
|
|||||||
}
|
}
|
||||||
#endif // GUI
|
#endif // GUI
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
void checkStartupWarnings()
|
|
||||||
{
|
|
||||||
if (startupWarningState < STARTUP_WARNING_DONE) {
|
|
||||||
if (startupWarningState == STARTUP_WARNING_THROTTLE)
|
|
||||||
checkTHR();
|
|
||||||
else
|
|
||||||
checkSwitches();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(EEPROM_RLC)
|
#if defined(EEPROM_RLC)
|
||||||
void checkLowEEPROM()
|
void checkLowEEPROM()
|
||||||
@@ -971,16 +956,6 @@ void checkTHR()
|
|||||||
// in case an output channel is choosen as throttle source (thrTraceSrc>NUM_POTS+NUM_SLIDERS) we assume the throttle stick is the input
|
// in case an output channel is choosen as throttle source (thrTraceSrc>NUM_POTS+NUM_SLIDERS) we assume the throttle stick is the input
|
||||||
// no other information available at the moment, and good enough to my option (otherwise too much exceptions...)
|
// no other information available at the moment, and good enough to my option (otherwise too much exceptions...)
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
int16_t v = calibratedAnalogs[thrchn];
|
|
||||||
if (v<=THRCHK_DEADBAND-1024 || g_model.disableThrottleWarning || pwrCheck()==e_power_off || keyDown()) {
|
|
||||||
startupWarningState = STARTUP_WARNING_THROTTLE+1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
calibratedAnalogs[thrchn] = -1024;
|
|
||||||
RAISE_ALERT(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP, AU_THROTTLE_ALERT);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (g_model.disableThrottleWarning) {
|
if (g_model.disableThrottleWarning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1046,7 +1021,6 @@ void checkTHR()
|
|||||||
CoTickDelay(10);
|
CoTickDelay(10);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
LED_ERROR_END();
|
LED_ERROR_END();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -502,15 +502,6 @@ enum PerOutMode {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
extern uint8_t startupWarningState;
|
|
||||||
|
|
||||||
enum StartupWarningStates {
|
|
||||||
STARTUP_WARNING_THROTTLE,
|
|
||||||
STARTUP_WARNING_SWITCHES,
|
|
||||||
STARTUP_WARNING_DONE,
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// Fiddle to force compiler to use a pointer
|
// Fiddle to force compiler to use a pointer
|
||||||
|
|||||||
@@ -429,20 +429,6 @@ bool getSwitch(swsrc_t swtch, uint8_t flags)
|
|||||||
result = switchState(cs_idx-SWSRC_FIRST_SWITCH);
|
result = switchState(cs_idx-SWSRC_FIRST_SWITCH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
if (startupWarningState < STARTUP_WARNING_DONE) {
|
|
||||||
// if throttle or switch warning is currently active, ignore actual stick position and use wanted values
|
|
||||||
if (cs_idx <= 3) {
|
|
||||||
if (!(g_model.switchWarningEnable & 1)) { // ID1 to ID3 is just one bit in switchWarningEnable
|
|
||||||
result = (cs_idx)==((g_model.switchWarningState & 3)+1); // overwrite result with desired value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!(g_model.switchWarningEnable & (1<<(cs_idx-3)))) {
|
|
||||||
// current switch should not be ignored for warning
|
|
||||||
result = g_model.switchWarningState & (1<<(cs_idx-2)); // overwrite result with desired value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#if NUM_XPOTS > 0
|
#if NUM_XPOTS > 0
|
||||||
else if (cs_idx <= SWSRC_LAST_MULTIPOS_SWITCH) {
|
else if (cs_idx <= SWSRC_LAST_MULTIPOS_SWITCH) {
|
||||||
@@ -558,18 +544,13 @@ swsrc_t getMovedSwitch()
|
|||||||
#if defined(GUI)
|
#if defined(GUI)
|
||||||
void checkSwitches()
|
void checkSwitches()
|
||||||
{
|
{
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
static swarnstate_t last_bad_switches = 0xff;
|
|
||||||
#else
|
|
||||||
swarnstate_t last_bad_switches = 0xff;
|
swarnstate_t last_bad_switches = 0xff;
|
||||||
#endif
|
|
||||||
swarnstate_t states = g_model.switchWarningState;
|
swarnstate_t states = g_model.switchWarningState;
|
||||||
|
|
||||||
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||||
uint8_t bad_pots = 0, last_bad_pots = 0xff;
|
uint8_t bad_pots = 0, last_bad_pots = 0xff;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
#if defined(TELEMETRY_MOD_14051) || defined(TELEMETRY_MOD_14051_SWAPPED)
|
#if defined(TELEMETRY_MOD_14051) || defined(TELEMETRY_MOD_14051_SWAPPED)
|
||||||
@@ -583,7 +564,6 @@ void checkSwitches()
|
|||||||
}
|
}
|
||||||
#undef GETADC_COUNT
|
#undef GETADC_COUNT
|
||||||
#endif
|
#endif
|
||||||
#endif // !defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
|
|
||||||
getMovedSwitch();
|
getMovedSwitch();
|
||||||
|
|
||||||
@@ -648,10 +628,6 @@ void checkSwitches()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!warn) {
|
if (!warn) {
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
startupWarningState = STARTUP_WARNING_SWITCHES+1;
|
|
||||||
last_bad_switches = 0xff;
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -765,12 +741,6 @@ void checkSwitches()
|
|||||||
last_bad_switches = switches_states;
|
last_bad_switches = switches_states;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
|
||||||
if (pwrCheck()==e_power_off || keyDown()) {
|
|
||||||
startupWarningState = STARTUP_WARNING_SWITCHES+1;
|
|
||||||
last_bad_switches = 0xff;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (pwrCheck() == e_power_off || keyDown()) break;
|
if (pwrCheck() == e_power_off || keyDown()) break;
|
||||||
|
|
||||||
doLoopCommonActions();
|
doLoopCommonActions();
|
||||||
@@ -780,7 +750,6 @@ void checkSwitches()
|
|||||||
SIMU_SLEEP(1);
|
SIMU_SLEEP(1);
|
||||||
CoTickDelay(10);
|
CoTickDelay(10);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
LED_ERROR_END();
|
LED_ERROR_END();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user