feat: special function to push customisable switches (#5497)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
3djc
2024-09-14 11:56:42 +10:00
committed by GitHub
co-authored by philmoz elecpower
parent 40449bf730
commit d417228677
48 changed files with 287 additions and 27 deletions
+6
View File
@@ -87,6 +87,7 @@ uint8_t potsPos[MAX_POTS];
// Pushed : SWSRC_Sx2 = +1024 = Sx(down) = state 1
uint8_t fsPreviousState = 0;
uint8_t functionSwitchFunctionState = 0;
void setFSStartupPosition()
{
@@ -131,6 +132,11 @@ void setFSLogicalState(uint8_t index, uint8_t value)
uint8_t getFSPhysicalState(uint8_t index)
{
#if defined(FUNCTION_SWITCHES)
if (bfSingleBitGet(functionSwitchFunctionState, index))
return true;
#endif
index += switchGetMaxSwitches();
return switchGetPosition(index) != SWITCH_HW_UP;
}