Skip to content

Commit 9d20ef5

Browse files
committed
Simplified ICACHE_RAM_ATTR / IRAM_ATTR usage per review comment.
1 parent d89091e commit 9d20ef5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

libraries/FunctionalInterrupt/examples/Functional/Functional.ino

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <FunctionalInterrupt.h>
22

3+
#ifndef IRAM_ATTR
4+
#define IRAM_ATTR ICACHE_RAM_ATTR
5+
#endif
6+
37
#if defined(ESP32)
48
#define BUTTON1 16
59
#define BUTTON2 17
@@ -32,21 +36,13 @@ class Button {
3236
detachInterrupt(PIN);
3337
}
3438

35-
#if defined(ESP8266)
36-
void ICACHE_RAM_ATTR buttonIsr()
37-
#elif defined(ESP32)
3839
void IRAM_ATTR buttonIsr()
39-
#endif
4040
{
4141
numberKeyPresses += 1;
4242
pressed = true;
4343
}
4444

45-
#if defined(ESP8266)
46-
static void ICACHE_RAM_ATTR buttonIsr_static(Button* const self)
47-
#elif defined(ESP32)
4845
static void IRAM_ATTR buttonIsr_static(Button* const self)
49-
#endif
5046
{
5147
self->buttonIsr();
5248
}

0 commit comments

Comments
 (0)