Reset pin states after switching the polarity of the input pins

This commit is contained in:
Renze Nicolai 2021-12-30 01:19:28 +01:00
parent 2e761530e5
commit 9d059dcf9c
2 changed files with 3 additions and 1 deletions

@ -1 +1 @@
Subproject commit 0350a5bd92d7848e6f3db2e80992677c98934f58
Subproject commit 10e413edd7d1b086c647b84f7dadf7bd1047789d

View file

@ -98,6 +98,8 @@ esp_err_t hardware_init() {
pca9555_set_gpio_polarity(&pca9555, PCA9555_PIN_BTN_BACK, true);
pca9555_set_gpio_polarity(&pca9555, PCA9555_PIN_BTN_ACCEPT, true);
pca9555.pin_state = 0; // Reset all pin states so that the interrupt function doesn't trigger all the handlers because we inverted the polarity :D
pca9555_set_interrupt_handler(&pca9555, PCA9555_PIN_BTN_START, button_handler);
pca9555_set_interrupt_handler(&pca9555, PCA9555_PIN_BTN_SELECT, button_handler);
pca9555_set_interrupt_handler(&pca9555, PCA9555_PIN_BTN_MENU, button_handler);