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)
|
#if defined(CPUARM)
|
||||||
#define GETSWITCH_MIDPOS_DELAY 1
|
#define GETSWITCH_MIDPOS_DELAY 1
|
||||||
bool getSwitch(int8_t swtch, uint8_t flags=0);
|
bool getSwitch(swsrc_t swtch, uint8_t flags=0);
|
||||||
#else
|
#else
|
||||||
bool getSwitch(int8_t swtch);
|
bool getSwitch(swsrc_t swtch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void logicalSwitchesTimerTick();
|
void logicalSwitchesTimerTick();
|
||||||
|
|
|
@ -235,7 +235,7 @@ bool getLogicalSwitch(uint8_t idx)
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
int8_t s = ls->andsw;
|
swsrc_t s = ls->andsw;
|
||||||
#else
|
#else
|
||||||
uint8_t s = ls->andsw;
|
uint8_t s = ls->andsw;
|
||||||
if (s > SWSRC_LAST_SWITCH) {
|
if (s > SWSRC_LAST_SWITCH) {
|
||||||
|
@ -443,9 +443,9 @@ DurationAndDelayProcessing:
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
bool getSwitch(int8_t swtch, uint8_t flags)
|
bool getSwitch(swsrc_t swtch, uint8_t flags)
|
||||||
#else
|
#else
|
||||||
bool getSwitch(int8_t swtch)
|
bool getSwitch(swsrc_t swtch)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
bool result;
|
bool result;
|
||||||
|
@ -547,7 +547,7 @@ bool getSwitch(int8_t swtch)
|
||||||
void evalLogicalSwitches(bool isCurrentPhase)
|
void evalLogicalSwitches(bool isCurrentPhase)
|
||||||
{
|
{
|
||||||
for (unsigned int idx=0; idx<NUM_LOGICAL_SWITCH; idx++) {
|
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);
|
bool result = getLogicalSwitch(idx);
|
||||||
if (isCurrentPhase) {
|
if (isCurrentPhase) {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
|
@ -61,14 +61,20 @@ TEST(getSwitch, circularCSW)
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
#if defined(PCBTARANIS)
|
||||||
TEST(getSwitch, OldTypeStickyCSW)
|
TEST(getSwitch, OldTypeStickyCSW)
|
||||||
{
|
{
|
||||||
RADIO_RESET();
|
RADIO_RESET();
|
||||||
MODEL_RESET();
|
MODEL_RESET();
|
||||||
MIXER_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();
|
evalLogicalSwitches();
|
||||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue