Fix valid button range check

Fix valid button range check
This commit is contained in:
Theo Arends 2019-01-28 18:04:33 +01:00
parent e63741ae4f
commit 4509019d64
1 changed files with 6 additions and 0 deletions

View File

@ -713,6 +713,12 @@ bool GetUsedInModule(uint8_t val, uint8_t *arr)
if ((val >= GPIO_KEY1_NP) && (val < GPIO_KEY1_NP + MAX_KEYS)) { if ((val >= GPIO_KEY1_NP) && (val < GPIO_KEY1_NP + MAX_KEYS)) {
offset = -(GPIO_KEY1_NP - GPIO_KEY1); offset = -(GPIO_KEY1_NP - GPIO_KEY1);
} }
if ((val >= GPIO_KEY1_INV) && (val < GPIO_KEY1_INV + MAX_KEYS)) {
offset = -(GPIO_KEY1_INV - GPIO_KEY1);
}
if ((val >= GPIO_KEY1_INV_NP) && (val < GPIO_KEY1_INV_NP + MAX_KEYS)) {
offset = -(GPIO_KEY1_INV_NP - GPIO_KEY1);
}
if ((val >= GPIO_SWT1) && (val < GPIO_SWT1 + MAX_SWITCHES)) { if ((val >= GPIO_SWT1) && (val < GPIO_SWT1 + MAX_SWITCHES)) {
offset = (GPIO_SWT1_NP - GPIO_SWT1); offset = (GPIO_SWT1_NP - GPIO_SWT1);