Skip to content

Commit f495be4

Browse files
committed
Merge branch 'fixdetachinterrupt' of https://github.com/vicatcu/Arduino
2 parents 777e726 + e9045d8 commit f495be4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

build/shared/revisions.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ ARDUINO 1.6.5
1919
[core]
2020
* AVR: delayMicroseconds(..) doesn't hang if called with 0. Thanks @cano64
2121
* AVR: delayMicroseconds(..), added support for 1Mhz, 12Mhz and 24Mhz. Thanks @cano64
22-
* SAM: added watchdog routing for Due. Thanks @bobc
22+
* AVR: added missing case in detachInterrupt(). Thanks @vicatcu
23+
* SAM: added watchdog routine for Due. Thanks @bobc
2324

2425
ARDUINO 1.6.4 - 2015.05.06
2526

hardware/arduino/avr/cores/arduino/WInterrupts.c

+12
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,18 @@ void detachInterrupt(uint8_t interruptNum) {
223223
#warning detachInterrupt may need some more work for this cpu (case 1)
224224
#endif
225225
break;
226+
227+
case 2:
228+
#if defined(EIMSK) && defined(INT2)
229+
EIMSK &= ~(1 << INT2);
230+
#elif defined(GICR) && defined(INT2)
231+
GICR &= ~(1 << INT2); // atmega32
232+
#elif defined(GIMSK) && defined(INT2)
233+
GIMSK &= ~(1 << INT2);
234+
#else
235+
#warning detachInterrupt may need some more work for this cpu (case 2)
236+
#endif
237+
break;
226238
#endif
227239
}
228240

0 commit comments

Comments
 (0)