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
+8
View File
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <assert.h>
#include "switches.h"
struct hw_switch_def {
const char* name;
@@ -64,6 +65,13 @@ SwitchHwPos boardSwitchGetPosition(uint8_t cat, uint8_t idx)
{
idx = get_switch_index(cat, idx);
#if defined(FUNCTION_SWITCHES)
if (IS_SWITCH_FS(idx + n_switches)) {
if (bfSingleBitGet(functionSwitchFunctionState, idx))
return SWITCH_HW_DOWN;
}
#endif
if (switchesStates[idx] < 0)
return SWITCH_HW_UP;
else if (switchesStates[idx] == 0)