Skip to content
Snippets Groups Projects
Commit d58b22d1 authored by rocketscream's avatar rocketscream
Browse files

Fixed attachInterrupt() for use during sleep

parent 8a95c1ea
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,9 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
enabled = 1;
}
// Enable wakeup capability on pin in case being used during sleep
EIC->WAKEUP.reg |= (1 << in);
// Assign pin to EIC
pinPeripheral(pin, PIO_EXTINT);
......@@ -118,6 +121,9 @@ void detachInterrupt(uint32_t pin)
return;
EIC->INTENCLR.reg = EIC_INTENCLR_EXTINT(1 << in);
// Disable wakeup capability on pin during sleep
EIC->WAKEUP.reg &= ~(1 << in);
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment