You've already forked ArduinoLowPower
mirror of
https://github.com/arduino-libraries/ArduinoLowPower.git
synced 2025-11-05 17:10:38 +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:
@@ -1,7 +1,6 @@
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
|
||||
#include "ArduinoLowPower.h"
|
||||
#include "WInterrupts.h"
|
||||
|
||||
static void configGCLK6()
|
||||
{
|
||||
@@ -72,7 +71,7 @@ void ArduinoLowPowerClass::deepSleep(uint32_t millis) {
|
||||
void ArduinoLowPowerClass::setAlarmIn(uint32_t millis) {
|
||||
|
||||
if (!rtc.isConfigured()) {
|
||||
attachInterruptWakeup(RTC_ALARM_WAKEUP, NULL, 0);
|
||||
attachInterruptWakeup(RTC_ALARM_WAKEUP, NULL, (irq_mode)0);
|
||||
}
|
||||
|
||||
uint32_t now = rtc.getEpoch();
|
||||
@@ -80,7 +79,7 @@ void ArduinoLowPowerClass::setAlarmIn(uint32_t millis) {
|
||||
rtc.enableAlarm(rtc.MATCH_YYMMDDHHMMSS);
|
||||
}
|
||||
|
||||
void ArduinoLowPowerClass::attachInterruptWakeup(uint32_t pin, voidFuncPtr callback, uint32_t mode) {
|
||||
void ArduinoLowPowerClass::attachInterruptWakeup(uint32_t pin, voidFuncPtr callback, irq_mode mode) {
|
||||
|
||||
if (pin > PINS_COUNT) {
|
||||
// check for external wakeup sources
|
||||
|
||||
Reference in New Issue
Block a user