File tree Expand file tree Collapse file tree 5 files changed +6
-23
lines changed Expand file tree Collapse file tree 5 files changed +6
-23
lines changed Original file line number Diff line number Diff line change 34
34
#include "shared-bindings/alarm/pin/PinAlarm.h"
35
35
#include "shared-bindings/microcontroller/__init__.h"
36
36
#include "shared-bindings/microcontroller/Pin.h"
37
+ #include "common-hal/alarm/__init__.h"
37
38
38
39
// This variable stores whether a PinAlarm woke in light sleep or fake deep sleep
39
40
// It CANNOT detect if the program woke from deep sleep.
@@ -52,9 +53,6 @@ void pin_alarm_callback(uint8_t num) { // parameters can be changed
52
53
// the trigger. This will only work for light sleep/fake deep
53
54
// sleep, in conjunction with the find_triggered_alarm function
54
55
55
- // Turn off interrupts while in handler
56
- // printf("Woke up from pin!!\n");
57
- // printf("EIC Flags: %lu\n",EIC->INTFLAG.reg);
58
56
if (pinalarm_on) {
59
57
// clear flag and interrupt setting
60
58
RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_TAMPER;
Original file line number Diff line number Diff line change 27
27
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_PINALARM_H
28
28
#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_PINALARM_H
29
29
30
- // This is the first byte of the BKUP register bank.
31
- // We use it to store which alarms are set.
32
- #ifndef SAMD_ALARM_FLAG
33
- #define SAMD_ALARM_FLAG (RTC->MODE0.BKUP[0].reg)
34
- #define SAMD_ALARM_FLAG_TIME (_U_(0x1) << 0)
35
- #define SAMD_ALARM_FLAG_PIN (_U_(0x1) << 1)
36
- #endif
37
-
38
30
#include "py/obj.h"
39
31
#include "py/objtuple.h"
40
32
Original file line number Diff line number Diff line change 30
30
31
31
#include "shared-bindings/alarm/time/TimeAlarm.h"
32
32
#include "shared-bindings/time/__init__.h"
33
+ #include "common-hal/alarm/__init__.h"
33
34
#include "supervisor/port.h"
34
35
35
36
STATIC volatile bool woke_up;
Original file line number Diff line number Diff line change 27
27
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TIMEALARM_H
28
28
#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TIMEALARM_H
29
29
30
- // This is the first byte of the BKUP register bank.
31
- // We use it to store which alarms are set.
32
- #ifndef SAMD_ALARM_FLAG
33
- #define SAMD_ALARM_FLAG (RTC->MODE0.BKUP[0].reg)
34
- #define SAMD_ALARM_FLAG_TIME (_U_(0x1) << 0)
35
- #define SAMD_ALARM_FLAG_PIN (_U_(0x1) << 1)
36
- #endif
37
-
38
30
#include "py/obj.h"
39
31
40
32
typedef struct {
Original file line number Diff line number Diff line change 53
53
#error Unknown chip family
54
54
#endif
55
55
56
- #include "common-hal/alarm/__init__.h"
57
56
#include "common-hal/analogio/AnalogIn.h"
58
57
#include "common-hal/analogio/AnalogOut.h"
59
58
#include "common-hal/audiobusio/PDMIn.h"
66
65
#include "common-hal/pwmio/PWMOut.h"
67
66
#include "common-hal/ps2io/Ps2.h"
68
67
#include "common-hal/rtc/RTC.h"
68
+ #include "common-hal/alarm/__init__.h"
69
+ #include "common-hal/alarm/time/TimeAlarm.h"
70
+ #include "common-hal/alarm/pin/PinAlarm.h"
69
71
70
72
#if CIRCUITPY_TOUCHIO_USE_NATIVE
71
73
#include "common-hal/touchio/TouchIn.h"
78
80
#include "samd/dma.h"
79
81
#include "shared-bindings/microcontroller/__init__.h"
80
82
#include "shared-bindings/rtc/__init__.h"
81
- #include "shared-bindings/alarm/time/TimeAlarm.h"
82
- #include "shared-bindings/alarm/pin/PinAlarm.h"
83
83
#include "shared_timers.h"
84
84
#include "reset.h"
85
85
@@ -194,7 +194,7 @@ static void rtc_init(void) {
194
194
#endif
195
195
#ifdef SAM_D5X_E5X
196
196
hri_mclk_set_APBAMASK_RTC_bit(MCLK);
197
- // Cache TAMPID?
197
+ // Cache TAMPID for wake up cause
198
198
(void)alarm_get_wakeup_cause();
199
199
RTC->MODE0.CTRLA.bit.SWRST = true;
200
200
while (RTC->MODE0.SYNCBUSY.bit.SWRST != 0) {
You can’t perform that action at this time.
0 commit comments