I have simple yet not working situation. Consider momentary button connected to ESP32. Negative edge interrupt enabled.
First case:
One leg of button to GND and one connected directly to ESP32
Software pull_up
Code: Select all
void add_button(uint8_t gpio_pin) {
gpio_config_t io_conf;
io_conf.intr_type = GPIO_PIN_INTR_NEGEDGE;
io_conf.pin_bit_mask = GPIO_PIN_SEL_CALC(gpio_pin);
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pull_up_en = 1;
io_conf.pull_down_en = 0;
gpio_config(&io_conf);
gpio_isr_handler_add(gpio_pin, gpio_isr_handler, (void *)gpio_pin);
}
In both cases interruption is triggering randomly, without any reason (button is not pressed). Even when there is no button connected to the port interruption is still triggering.
I am using ESP32-devkit v1
ESP-IDF v4.2-dev-583-ga3816bcb7
Here is whole code:
https://github.com/bartoszwalicki/home- ... /buttons.c