feat: add inverted sources (#4722)

Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
Neil Horne
2024-05-25 09:25:15 +10:00
committed by GitHub
co-authored by elecpower
parent ca50d4ee04
commit 80659c3e3f
87 changed files with 798 additions and 496 deletions
@@ -167,7 +167,7 @@ struct YamlThrTrace {
YamlThrTrace(unsigned int cpn_value)
{
if (cpn_value == 0) {
src = RawSource(SOURCE_TYPE_STICK, 2/* throttle */);
src = RawSource(SOURCE_TYPE_INPUT, 2/* throttle */);
return;
}
cpn_value--;
@@ -175,7 +175,7 @@ struct YamlThrTrace {
int pots = board.getCapability(Board::Pots);
int sliders = board.getCapability(Board::Sliders);
if (cpn_value < (unsigned int)(pots + sliders)) {
src = RawSource(SOURCE_TYPE_STICK, 4/* sticks */ + cpn_value);
src = RawSource(SOURCE_TYPE_INPUT, 4/* sticks */ + cpn_value);
}
else {
cpn_value -= pots + sliders;
@@ -186,7 +186,7 @@ struct YamlThrTrace {
unsigned int toCpn()
{
switch (src.type) {
case SOURCE_TYPE_STICK:
case SOURCE_TYPE_INPUT:
if (src.index == 2 /* throttle */) {
return 0;
} else {