1
0
mirror of https://github.com/arduino-libraries/ArduinoLowPower.git synced 2025-10-16 02:46:40 +03:00

Make the library compatible with both API and non API cores (#35)

Fixes https://github.com/arduino/ArduinoCore-samd/issues/578
This commit is contained in:
Martino Facchin
2020-12-17 10:54:44 +01:00
committed by GitHub
parent 043dedba33
commit b44168f223
2 changed files with 9 additions and 4 deletions

View File

@@ -18,6 +18,12 @@
#define RTC_ALARM_WAKEUP 0xFF
#ifdef ARDUINO_API_VERSION
using irq_mode = PinStatus;
#else
using irq_mode = uint32_t;
#endif
//typedef void (*voidFuncPtr)( void ) ;
typedef void (*onOffFuncPtr)( bool ) ;
@@ -59,7 +65,7 @@ class ArduinoLowPowerClass {
deepSleep((uint32_t)millis);
}
void attachInterruptWakeup(uint32_t pin, voidFuncPtr callback, uint32_t mode);
void attachInterruptWakeup(uint32_t pin, voidFuncPtr callback, irq_mode mode);
#ifdef BOARD_HAS_COMPANION_CHIP
void companionLowPowerCallback(onOffFuncPtr callback) {