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:
co-authored by
philmoz
elecpower
parent
40449bf730
commit
d417228677
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user