Skip to content

Commit 5bff1ad

Browse files
committed
Workaround for old ESP libs
1 parent 598a441 commit 5bff1ad

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/private/IRTimer.hpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,20 +1369,28 @@ hw_timer_t *s50usTimer; // set by timerConfigForReceive()
13691369
void timerEnableReceiveInterrupt() {
13701370
timerAlarmEnable (s50usTimer);
13711371
}
1372-
#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(2, 0, 2)
1372+
1373+
#if !defined(ESP_ARDUINO_VERSION)
1374+
#define ESP_ARDUINO_VERSION 0
1375+
#endif
1376+
#if !defined(ESP_ARDUINO_VERSION_VAL)
1377+
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 202
1378+
#endif
1379+
# if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(2, 0, 2)
13731380
void timerDisableReceiveInterrupt() {
13741381
if (s50usTimer != NULL) {
13751382
timerEnd(s50usTimer);
13761383
timerDetachInterrupt(s50usTimer);
13771384
}
13781385
}
1379-
#else
1386+
# else
13801387
void timerDisableReceiveInterrupt() {
13811388
if (s50usTimer != NULL) {
13821389
timerAlarmDisable (s50usTimer);
13831390
}
13841391
}
1385-
#endif
1392+
# endif
1393+
13861394
// Undefine ISR, because we register/call the plain function IRReceiveTimerInterruptHandler()
13871395
# if defined(ISR)
13881396
#undef ISR

0 commit comments

Comments
 (0)