Some definitions are not clear to me:
- Is it necessary to disable the interrupt if the pin is output?
Code: Select all
64: io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
- Why "GPIO_INPUT_IO_0" interrupt type is defined repeatedly on lines 77 and 87? Would not be sufficient to define it once?
Code: Select all
77: io_conf.intr_type = GPIO_PIN_INTR_POSEDGE;
87: gpio_set_intr_type(GPIO_INPUT_IO_0, GPIO_INTR_ANYEDGE);
- Why no interrupt type for "GPIO_INPUT_IO_1" is missing?
- Why ISR handler for "GPIO_INPUT_IO_0" added and then removed and added again?
Code: Select all
97: gpio_isr_handler_add(GPIO_INPUT_IO_0, gpio_isr_handler, (void*) GPIO_INPUT_IO_0);
102: gpio_isr_handler_remove(GPIO_INPUT_IO_0);
104: gpio_isr_handler_add(GPIO_INPUT_IO_0, gpio_isr_handler, (void*) GPIO_INPUT_IO_0);