Reduced number of logical switch context to 2. Now we have only active fm context (lswFM[0]) and other context that is used for all other fms (lswFm[1]).
Much smaller RAM usage, but possible (I beleave unimportant) errors when trasitioning between more than two flight modes.
This commit is contained in:
+3
-3
@@ -524,7 +524,7 @@ uint8_t s_current_mixer_flight_mode;
|
||||
void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
|
||||
{
|
||||
evalInputs(mode);
|
||||
evalLogicalSwitches(mode);
|
||||
evalLogicalSwitches();
|
||||
|
||||
#if defined(MODULE_ALWAYS_SEND_PULSES)
|
||||
checkStartupWarnings();
|
||||
@@ -918,6 +918,7 @@ int32_t sum_chans512[NUM_CHNOUT] = {0};
|
||||
|
||||
|
||||
#define MAX_ACT 0xffff
|
||||
uint8_t s_last_phase = 255; // TODO reinit everything here when the model changes, no???
|
||||
|
||||
void evalMixes(uint8_t tick10ms)
|
||||
{
|
||||
@@ -928,7 +929,6 @@ void evalMixes(uint8_t tick10ms)
|
||||
static uint16_t fp_act[MAX_FLIGHT_MODES] = {0};
|
||||
static uint16_t delta = 0;
|
||||
static ACTIVE_PHASES_TYPE s_fade_flight_phases = 0;
|
||||
static uint8_t s_last_phase = 255; // TODO reinit everything here when the model changes, no???
|
||||
|
||||
uint8_t phase = getFlightPhase();
|
||||
|
||||
@@ -951,7 +951,7 @@ void evalMixes(uint8_t tick10ms)
|
||||
fp_act[s_last_phase] = 0;
|
||||
fp_act[phase] = MAX_ACT;
|
||||
}
|
||||
logicalSwitchesCopyState(s_last_phase, phase); //push last logical switches state from old to new phase
|
||||
logicalSwitchesCopyState(); //push last logical switches state from old to new phase
|
||||
}
|
||||
s_last_phase = phase;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user