| 94 | } |
| 95 | |
| 96 | void attachInterruptHandler(uint8_t pin, GPIO_INT_TYPE type) |
| 97 | { |
| 98 | if(!interruptHandlerAttached) { |
| 99 | gpio_isr_register(interruptHandler, NULL, (int)ESP_INTR_FLAG_IRAM, &interruptHandle); |
| 100 | interruptHandlerAttached = true; |
| 101 | } |
| 102 | |
| 103 | gpio_intr_disable((gpio_num_t)pin); |
| 104 | |
| 105 | pinMode(pin, INPUT); |
| 106 | |
| 107 | gpio_set_intr_type((gpio_num_t)pin, (gpio_int_type_t)type); |
| 108 | gpio_intr_enable((gpio_num_t)pin); |
| 109 | } |
| 110 | |
| 111 | void detachInterrupt(uint8_t pin) |
| 112 | { |
no test coverage detected