Skip to content

Commit 37bddec

Browse files
committed
adding CIRCUITPY_ALARM checks to port.c
1 parent 5c4f903 commit 37bddec

File tree

1 file changed

+7
-0
lines changed
  • ports/atmel-samd/supervisor

1 file changed

+7
-0
lines changed

ports/atmel-samd/supervisor/port.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@
6565
#include "common-hal/pwmio/PWMOut.h"
6666
#include "common-hal/ps2io/Ps2.h"
6767
#include "common-hal/rtc/RTC.h"
68+
69+
#if CIRCUITPY_ALARM
6870
#include "common-hal/alarm/__init__.h"
6971
#include "common-hal/alarm/time/TimeAlarm.h"
7072
#include "common-hal/alarm/pin/PinAlarm.h"
73+
#endif
7174

7275
#if CIRCUITPY_TOUCHIO_USE_NATIVE
7376
#include "common-hal/touchio/TouchIn.h"
@@ -194,8 +197,10 @@ static void rtc_init(void) {
194197
#endif
195198
#ifdef SAM_D5X_E5X
196199
hri_mclk_set_APBAMASK_RTC_bit(MCLK);
200+
#if CIRCUITPY_ALARM
197201
// Cache TAMPID for wake up cause
198202
(void)alarm_get_wakeup_cause();
203+
#endif
199204
RTC->MODE0.CTRLA.bit.SWRST = true;
200205
while (RTC->MODE0.SYNCBUSY.bit.SWRST != 0) {
201206
}
@@ -493,6 +498,7 @@ void RTC_Handler(void) {
493498
// Do things common to all ports when the tick occurs
494499
supervisor_tick();
495500
}
501+
#if CIRCUITPY_ALARM
496502
if (intflag & RTC_MODE0_INTFLAG_CMP1) {
497503
// Likely TimeAlarm fake sleep wake
498504
time_alarm_callback();
@@ -504,6 +510,7 @@ void RTC_Handler(void) {
504510
RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_TAMPER;
505511
}
506512
#endif
513+
#endif
507514
if (intflag & RTC_MODE0_INTFLAG_CMP0) {
508515
// Clear the interrupt because we may have hit a sleep
509516
RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0;

0 commit comments

Comments
 (0)