feat: Deadzone option for NV14 sticks (#1777)
Imported from open-flysky/Flysky-OpenTX-Test-Branch * companion: Don't nuke `stickDeadZone` setting * Implement data storage properly * Add missing check for NV14 storage struct sizes * Formatting * Use one less byte in the packed data struct Thanks @raphaelcoeffic :) * Move setting of stickDeadZone default * Use a Choice combo rather than NumberEdit * Good riddance magic number * Also set default stick zone if setting is missing * Teach tests about `STICK_DEAD_ZONE` * Tweak choice width * Cpn NV14 add stick dead zone to hardware and section labels * Cpn NV14 align default pot names to radio Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
co-authored by
elecpower
parent
9d27a6923c
commit
d9b51f8ecf
@@ -337,7 +337,11 @@ TEST_F(TrimsTest, CopySticksToOffset)
|
||||
anaInValues[ELE_STICK] = -100;
|
||||
evalMixes(1);
|
||||
copySticksToOffset(1);
|
||||
#if defined(STICK_DEAD_ZONE)
|
||||
EXPECT_EQ(g_model.limitData[1].offset, -93);
|
||||
#else
|
||||
EXPECT_EQ(g_model.limitData[1].offset, -97);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_F(TrimsTest, MoveTrimsToOffsets)
|
||||
@@ -444,7 +448,11 @@ TEST_F(TrimsTest, InstantTrim)
|
||||
{
|
||||
anaInValues[AIL_STICK] = 50;
|
||||
instantTrim();
|
||||
#if defined(STICK_DEAD_ZONE)
|
||||
EXPECT_EQ(23, getTrimValue(0, AIL_STICK));
|
||||
#else
|
||||
EXPECT_EQ(25, getTrimValue(0, AIL_STICK));
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_F(TrimsTest, InstantTrimNegativeCurve)
|
||||
@@ -459,7 +467,11 @@ TEST_F(TrimsTest, InstantTrimNegativeCurve)
|
||||
g_model.points[4] = 0;
|
||||
anaInValues[AIL_STICK] = 512;
|
||||
instantTrim();
|
||||
#if defined(STICK_DEAD_ZONE)
|
||||
EXPECT_EQ(127, getTrimValue(0, AIL_STICK));
|
||||
#else
|
||||
EXPECT_EQ(128, getTrimValue(0, AIL_STICK));
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(Curves, LinearIntpol)
|
||||
|
||||
Reference in New Issue
Block a user