mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +03:00
Move attachInterrupt and detachInterrupt into IRAM (#1734)
This commit is contained in:
parent
8d43c40311
commit
6b0a117e3d
@ -134,7 +134,7 @@ void ICACHE_RAM_ATTR interrupt_handler(void *arg) {
|
|||||||
ETS_GPIO_INTR_ENABLE();
|
ETS_GPIO_INTR_ENABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int mode) {
|
extern void ICACHE_RAM_ATTR __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int mode) {
|
||||||
if(pin < 16) {
|
if(pin < 16) {
|
||||||
interrupt_handler_t *handler = &interrupt_handlers[pin];
|
interrupt_handler_t *handler = &interrupt_handlers[pin];
|
||||||
handler->mode = mode;
|
handler->mode = mode;
|
||||||
@ -146,7 +146,7 @@ extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void __detachInterrupt(uint8_t pin) {
|
extern void ICACHE_RAM_ATTR __detachInterrupt(uint8_t pin) {
|
||||||
if(pin < 16) {
|
if(pin < 16) {
|
||||||
GPC(pin) &= ~(0xF << GPCI);//INT mode disabled
|
GPC(pin) &= ~(0xF << GPCI);//INT mode disabled
|
||||||
GPIEC = (1 << pin); //Clear Interrupt for this pin
|
GPIEC = (1 << pin); //Clear Interrupt for this pin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user