Skip to content

Fixed issue #25. Possible corruption in attachInterrupt. #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cores/arduino/WInterrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static volatile voidFuncPtr intFunc[EXTERNAL_NUM_INTERRUPTS] = {
// volatile static voidFuncPtr twiIntFunc;

void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
if(interruptNum < EXTERNAL_NUM_INTERRUPTS) {
if((interruptNum < EXTERNAL_NUM_INTERRUPTS) && (interruptNum != NOT_AN_INTERRUPT)) {
intFunc[interruptNum] = userFunc;

// Configure the interrupt mode (trigger on low input, any change, rising
Expand Down Expand Up @@ -185,7 +185,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
}

void detachInterrupt(uint8_t interruptNum) {
if(interruptNum < EXTERNAL_NUM_INTERRUPTS) {
if((interruptNum < EXTERNAL_NUM_INTERRUPTS) && (interruptNum != NOT_AN_INTERRUPT)) {
// Disable the interrupt. (We can't assume that interruptNum is equal
// to the number of the EIMSK bit to clear, as this isn't true on the
// ATmega8. There, INT0 is 6 and INT1 is 7.)
Expand Down