mirror of
https://github.com/FunKey-Project/fkgpiod.git
synced 2026-02-06 15:05:30 +01:00
substracting the activated mask when a mapping is found regardless of already activated or not
This commit is contained in:
parent
3e0babfb0c
commit
1e1cbf719b
@ -134,10 +134,7 @@ static void apply_mapping(mapping_list_t *list, uint32_t gpio_mask)
|
||||
#endif // DEBUG_GPIO
|
||||
if (mapping->activated == false) {
|
||||
|
||||
/* Mapping is not yet active, subtract the matching GPIOs from
|
||||
* the current GPIO mask and activate it
|
||||
*/
|
||||
gpio_mask ^= mapping->gpio_mask;
|
||||
/* Activate mapping */
|
||||
mapping->activated = true;
|
||||
if (mapping->type == MAPPING_KEY) {
|
||||
|
||||
@ -152,6 +149,11 @@ static void apply_mapping(mapping_list_t *list, uint32_t gpio_mask)
|
||||
system(mapping->value.command);
|
||||
}
|
||||
}
|
||||
|
||||
/* Subtract the matching GPIOs from
|
||||
* the current GPIO mask and activate it
|
||||
*/
|
||||
gpio_mask ^= mapping->gpio_mask;
|
||||
} else if (mapping->activated) {
|
||||
|
||||
/* Non-matching activated mapping, deactivate it */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user