Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/hal/hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,17 @@ static void hal_io_check() {
// Interrupt handlers
static ostime_t interrupt_time[NUM_DIO] = {0};

LMIC_ISR_ATTR
static void hal_isrPin0() {
ostime_t now = os_getTime();
interrupt_time[0] = now ? now : 1;
}
LMIC_ISR_ATTR
static void hal_isrPin1() {
ostime_t now = os_getTime();
interrupt_time[1] = now ? now : 1;
}
LMIC_ISR_ATTR
static void hal_isrPin2() {
ostime_t now = os_getTime();
interrupt_time[2] = now ? now : 1;
Expand Down
7 changes: 7 additions & 0 deletions src/lmic/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,11 @@
# define LMIC_ENABLE_arbitrary_clock_error 0 /* PARAM */
#endif

#if defined(ESP8266) || defined(ESP32)
// functions called from an interrupt context need this attribute
#define LMIC_ISR_ATTR ICACHE_RAM_ATTR
#else
#define LMIC_ISR_ATTR
#endif

#endif // _lmic_config_h_