MCPcopy Create free account
hub / github.com/SmingHub/Sming / attachInterruptHandler

Function attachInterruptHandler

Sming/Arch/Esp32/Core/Interrupts.cpp:96–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void 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
111void detachInterrupt(uint8_t pin)
112{

Callers 2

attachInterruptFunction · 0.70
detachInterruptFunction · 0.70

Calls 1

pinModeFunction · 0.70

Tested by

no test coverage detected