Skip to content

Commit

Permalink
fix(tpro): auto-switch for function switches
Browse files Browse the repository at this point in the history
Fixes #1488
  • Loading branch information
raphaelcoeffic committed Oct 10, 2022
1 parent 69d328f commit cda53c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radio/src/switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,8 @@ swsrc_t getMovedSwitch()
auto prev = (uint8_t )(bfSingleBitGet(fsswitches_states, i) >> (i));
uint8_t next = getFSLogicalState(i);
if (prev != next) {
switches_states ^= (-next ^ switches_states) & (1 << i);
result = 2 + (3 * (i + NUM_REGULAR_SWITCHES)) + next;
fsswitches_states = (fsswitches_states & ~(1 << i)) | (next << i);
result = SWSRC_FIRST_FUNCTION_SWITCH + i*3 + (next ? 2 : 0);
}
}
}
Expand Down

0 comments on commit cda53c8

Please sign in to comment.