fix(tx16smk3): allow invert flag for BSP, invert SI and SJ (#7425)
This commit is contained in:
@@ -257,7 +257,7 @@
|
|||||||
"name": "SI",
|
"name": "SI",
|
||||||
"type": "2POS",
|
"type": "2POS",
|
||||||
"flags": 0,
|
"flags": 0,
|
||||||
"inverted": false,
|
"inverted": true,
|
||||||
"default": "NONE",
|
"default": "NONE",
|
||||||
"display": null,
|
"display": null,
|
||||||
"gpio": null,
|
"gpio": null,
|
||||||
@@ -268,7 +268,7 @@
|
|||||||
"name": "SJ",
|
"name": "SJ",
|
||||||
"type": "2POS",
|
"type": "2POS",
|
||||||
"flags": 0,
|
"flags": 0,
|
||||||
"inverted": false,
|
"inverted": true,
|
||||||
"default": "NONE",
|
"default": "NONE",
|
||||||
"display": null,
|
"display": null,
|
||||||
"gpio": null,
|
"gpio": null,
|
||||||
|
|||||||
@@ -222,6 +222,12 @@ static SwitchHwPos _get_switch_pos(uint8_t idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (def->inverted) {
|
||||||
|
pos = pos == SWITCH_HW_UP ? SWITCH_HW_DOWN
|
||||||
|
: pos == SWITCH_HW_DOWN ? SWITCH_HW_UP
|
||||||
|
: pos;
|
||||||
|
}
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user