Skip to content

Commit 7218bcc

Browse files
committed
Add supporting function for interrupt arg memory management, linke with functional interrupts.
1 parent 1758a18 commit 7218bcc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cores/esp8266/core_esp8266_wiring_digital.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,17 @@ extern void __detachInterrupt(uint8_t pin) {
187187
interrupt_reg &= ~(1 << pin);
188188
interrupt_handler_t* handler = &interrupt_handlers[pin];
189189
handler->mode = 0;
190-
handler->fn = 0;
191-
handler->arg = 0;
190+
handler->fn = nullptr;
191+
handler->arg = nullptr;
192192
if (interrupt_reg)
193193
ETS_GPIO_INTR_ENABLE();
194194
}
195195
}
196196

197+
extern interrupt_handler_t* __getInterruptHandler(uint8_t pin) {
198+
return (pin < 16) ? &interrupt_handlers[pin] : nullptr;
199+
}
200+
197201
extern void __resetPins() {
198202
for (int i = 0; i <= 16; ++i) {
199203
if (!isFlashInterfacePin(i))

0 commit comments

Comments
 (0)