Refactoring continued: Try to run lua scripts before the first LCD function
This commit is contained in:
@@ -42,8 +42,10 @@ inline void MIXER_RESET()
|
||||
|
||||
inline void TELEMETRY_RESET()
|
||||
{
|
||||
#if defined(FRSKY)
|
||||
memclear(&frskyData, sizeof(frskyData));
|
||||
TELEMETRY_RSSI() = 100;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MIXER_RESET();
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
extern const char * zchar2string(const char * zstring, int size);
|
||||
#define EXPECT_ZSTREQ(c_string, z_string) EXPECT_STREQ(c_string, zchar2string(z_string, sizeof(z_string)))
|
||||
extern void luaInit();
|
||||
|
||||
void luaExecStr(const char * str)
|
||||
{
|
||||
|
||||
@@ -391,7 +391,11 @@ TEST(Trims, CopySticksToOffset)
|
||||
MODEL_RESET();
|
||||
modelDefault(0);
|
||||
anaInValues[ELE_STICK] = -100;
|
||||
#if defined(CPUARM)
|
||||
doMixerCalculations();
|
||||
#else
|
||||
perMain();
|
||||
#endif
|
||||
copySticksToOffset(1);
|
||||
EXPECT_EQ(g_model.limitData[1].offset, -97);
|
||||
}
|
||||
@@ -618,11 +622,19 @@ TEST(Mixer, RecursiveAddChannelAfterInactivePhase)
|
||||
g_model.mixData[2].srcRaw = MIXSRC_MAX;
|
||||
g_model.mixData[2].weight = 100;
|
||||
simuSetSwitch(3, -1);
|
||||
#if defined(CPUARM)
|
||||
doMixerCalculations();
|
||||
#else
|
||||
perMain();
|
||||
#endif
|
||||
EXPECT_EQ(chans[0], CHANNEL_MAX/2);
|
||||
EXPECT_EQ(chans[1], CHANNEL_MAX);
|
||||
simuSetSwitch(3, 0);
|
||||
#if defined(CPUARM)
|
||||
doMixerCalculations();
|
||||
#else
|
||||
perMain();
|
||||
#endif
|
||||
EXPECT_EQ(chans[0], CHANNEL_MAX/2);
|
||||
EXPECT_EQ(chans[1], CHANNEL_MAX);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user