File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 18
18
19
19
#define RTC_ALARM_WAKEUP 0xFF
20
20
21
+ #ifdef ARDUINO_API_VERSION
22
+ using irq_mode = PinStatus;
23
+ #else
24
+ using irq_mode = uint32_t ;
25
+ #endif
26
+
21
27
// typedef void (*voidFuncPtr)( void ) ;
22
28
typedef void (*onOffFuncPtr)( bool ) ;
23
29
@@ -59,7 +65,7 @@ class ArduinoLowPowerClass {
59
65
deepSleep ((uint32_t )millis);
60
66
}
61
67
62
- void attachInterruptWakeup (uint32_t pin, voidFuncPtr callback, uint32_t mode);
68
+ void attachInterruptWakeup (uint32_t pin, voidFuncPtr callback, irq_mode mode);
63
69
64
70
#ifdef BOARD_HAS_COMPANION_CHIP
65
71
void companionLowPowerCallback (onOffFuncPtr callback) {
Original file line number Diff line number Diff line change 1
1
#if defined(ARDUINO_ARCH_SAMD)
2
2
3
3
#include " ArduinoLowPower.h"
4
- #include " WInterrupts.h"
5
4
6
5
static void configGCLK6 ()
7
6
{
@@ -72,15 +71,15 @@ void ArduinoLowPowerClass::deepSleep(uint32_t millis) {
72
71
void ArduinoLowPowerClass::setAlarmIn (uint32_t millis) {
73
72
74
73
if (!rtc.isConfigured ()) {
75
- attachInterruptWakeup (RTC_ALARM_WAKEUP, NULL , 0 );
74
+ attachInterruptWakeup (RTC_ALARM_WAKEUP, NULL , (irq_mode) 0 );
76
75
}
77
76
78
77
uint32_t now = rtc.getEpoch ();
79
78
rtc.setAlarmEpoch (now + millis/1000 );
80
79
rtc.enableAlarm (rtc.MATCH_YYMMDDHHMMSS );
81
80
}
82
81
83
- void ArduinoLowPowerClass::attachInterruptWakeup (uint32_t pin, voidFuncPtr callback, uint32_t mode) {
82
+ void ArduinoLowPowerClass::attachInterruptWakeup (uint32_t pin, voidFuncPtr callback, irq_mode mode) {
84
83
85
84
if (pin > PINS_COUNT) {
86
85
// check for external wakeup sources
You can’t perform that action at this time.
0 commit comments