mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Fixes compilation in 'next'
This commit is contained in:
parent
3387395932
commit
10f5bd211b
3 changed files with 14 additions and 8 deletions
|
@ -748,9 +748,9 @@ getvalue_t getValue(mixsrc_t i);
|
|||
|
||||
#if defined(CPUARM)
|
||||
#define GETSWITCH_MIDPOS_DELAY 1
|
||||
bool getSwitch(int8_t swtch, uint8_t flags=0);
|
||||
bool getSwitch(swsrc_t swtch, uint8_t flags=0);
|
||||
#else
|
||||
bool getSwitch(int8_t swtch);
|
||||
bool getSwitch(swsrc_t swtch);
|
||||
#endif
|
||||
|
||||
void logicalSwitchesTimerTick();
|
||||
|
|
|
@ -235,7 +235,7 @@ bool getLogicalSwitch(uint8_t idx)
|
|||
bool result;
|
||||
|
||||
#if defined(CPUARM)
|
||||
int8_t s = ls->andsw;
|
||||
swsrc_t s = ls->andsw;
|
||||
#else
|
||||
uint8_t s = ls->andsw;
|
||||
if (s > SWSRC_LAST_SWITCH) {
|
||||
|
@ -443,9 +443,9 @@ DurationAndDelayProcessing:
|
|||
}
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool getSwitch(int8_t swtch, uint8_t flags)
|
||||
bool getSwitch(swsrc_t swtch, uint8_t flags)
|
||||
#else
|
||||
bool getSwitch(int8_t swtch)
|
||||
bool getSwitch(swsrc_t swtch)
|
||||
#endif
|
||||
{
|
||||
bool result;
|
||||
|
@ -547,7 +547,7 @@ bool getSwitch(int8_t swtch)
|
|||
void evalLogicalSwitches(bool isCurrentPhase)
|
||||
{
|
||||
for (unsigned int idx=0; idx<NUM_LOGICAL_SWITCH; idx++) {
|
||||
LogicalSwitchContext &context = lswFm[mixerCurrentFlightMode].lsw[idx];
|
||||
LogicalSwitchContext & context = lswFm[mixerCurrentFlightMode].lsw[idx];
|
||||
bool result = getLogicalSwitch(idx);
|
||||
if (isCurrentPhase) {
|
||||
if (result) {
|
||||
|
|
|
@ -61,14 +61,20 @@ TEST(getSwitch, circularCSW)
|
|||
}
|
||||
#endif
|
||||
|
||||
#define SET_LOGICAL_SWITCH(index, _func, _v1, _v2) ( \
|
||||
g_model.logicalSw[index].func = _func, \
|
||||
g_model.logicalSw[index].v1 = _v1, \
|
||||
g_model.logicalSw[index].v2 = _v2 )
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
TEST(getSwitch, OldTypeStickyCSW)
|
||||
{
|
||||
RADIO_RESET();
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
g_model.logicalSw[0] = { LS_FUNC_AND, SWSRC_SA0, 0, 0, };
|
||||
g_model.logicalSw[1] = { LS_FUNC_OR, SWSRC_SW1, SWSRC_SW2, 0 };
|
||||
|
||||
SET_LOGICAL_SWITCH(0, LS_FUNC_AND, SWSRC_SA0, SWSRC_NONE);
|
||||
SET_LOGICAL_SWITCH(1, LS_FUNC_OR, SWSRC_SW1, SWSRC_SW2);
|
||||
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue