Skip to content

Commit 9204b58

Browse files
committed
Target only SAMD architecture
1 parent 0f7f590 commit 9204b58

11 files changed

+8
-4254
lines changed

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name=Arduino Low Power
22
version=1.0.0
33
author=Arduino
44
maintainer=Arduino LLC
5-
sentence=Power save primitives features for 32 bit boards
5+
sentence=Power save primitives features for SAMD 32bit boards
66
paragraph=With this library you can manage the low power states of newer Arduino boards
77
category=Device Control
88
url=http://arduino.cc/libraries/ArduinoLowPower
9-
architectures=samd,arc32
9+
architectures=samd

src/ArduinoLowPowerSAMD.cpp renamed to src/ArduinoLowPower.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#include "ArduinoLowPower.h"
2-
3-
#ifdef ARDUINO_ARCH_SAMD
4-
52
#include "WInterrupts.h"
63

74
void ArduinoLowPowerClass::idle() {
@@ -64,7 +61,7 @@ void ArduinoLowPowerClass::attachInterruptWakeup(uint32_t pin, voidFuncPtr callb
6461
if (in == NOT_AN_INTERRUPT || in == EXTERNAL_INT_NMI)
6562
return;
6663

67-
pinMode(pin, INPUT_PULLUP);
64+
//pinMode(pin, INPUT_PULLUP);
6865
attachInterrupt(pin, callback, mode);
6966

7067
// enable EIC clock
@@ -89,6 +86,4 @@ void ArduinoLowPowerClass::attachInterruptWakeup(uint32_t pin, voidFuncPtr callb
8986
NVMCTRL->CTRLB.bit.SLEEPPRM = NVMCTRL_CTRLB_SLEEPPRM_DISABLED_Val;
9087
}
9188

92-
ArduinoLowPowerClass LowPower;
93-
94-
#endif
89+
ArduinoLowPowerClass LowPower;

src/ArduinoLowPower.h

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
#error The library is not compatible with AVR boards
88
#endif
99

10-
#ifdef __ARDUINO_ARC__
11-
#include "include/arc32/defines.h"
12-
#endif
13-
1410
#ifdef ARDUINO_ARCH_SAMD
1511
#include "RTCZero.h"
1612
#endif
@@ -20,6 +16,8 @@
2016
#define BOARD_HAS_COMPANION_CHIP
2117
#endif
2218

19+
#define RTC_ALARM_WAKEUP 0xFF
20+
2321
//typedef void (*voidFuncPtr)( void ) ;
2422
typedef void (*onOffFuncPtr)( bool ) ;
2523

@@ -57,42 +55,12 @@ class ArduinoLowPowerClass {
5755
}
5856
#endif
5957

60-
#ifdef __ARDUINO_ARC__
61-
void wakeFromSleepCallback(void);
62-
void wakeFromDoze(void);
63-
void detachInterruptWakeup(uint32_t pin);
64-
uint32_t arc_restore_addr;
65-
#endif
66-
6758
private:
68-
#ifdef ARDUINO_ARCH_SAMD
6959
void setAlarmIn(uint32_t millis);
7060
RTCZero rtc;
71-
#define RTC_ALARM_WAKEUP 0xFF
72-
#endif
73-
74-
#ifdef __ARDUINO_ARC__
75-
void turnOffUSB();
76-
void turnOnUSB();
77-
void switchToHybridOscillator();
78-
void switchToCrystalOscillator();
79-
void setRTCCMR(int seconds);
80-
uint32_t readRTC_CCVR();
81-
bool isSleeping = false;
82-
volatile bool dozing = false;
83-
uint32_t millisToRTCTicks(int milliseconds);
84-
void enableRTCInterrupt(int seconds);
85-
void enableAONGPIOInterrupt(int aon_gpio, int mode);
86-
void enableAONPTimerInterrrupt(int millis);
87-
static void resetAONPTimer();
88-
static void wakeFromRTC();
89-
void x86_C2Request();
90-
void x86_C2LPRequest();
91-
void (*pmCB)();
92-
#define RTC_ALARM_WAKEUP 0xFF
93-
#define RESET_BUTTON_WAKEUP 0xFE
94-
#endif
61+
#ifdef BOARD_HAS_COMPANION_CHIP
9562
void (*companionSleepCB)(bool);
63+
#endif
9664
};
9765

9866
extern ArduinoLowPowerClass LowPower;

0 commit comments

Comments
 (0)