From 07b86fcb765484ae2cbfd414c4eb0891f29a597f Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 29 Apr 2021 17:28:06 -0400 Subject: [PATCH] fix sleepmemory object redefine error --- ports/stm/common-hal/alarm/__init__.c | 8 ++++++++ ports/stm/common-hal/alarm/__init__.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/stm/common-hal/alarm/__init__.c b/ports/stm/common-hal/alarm/__init__.c index 0d8f8a5ff9..4ebadd7c63 100644 --- a/ports/stm/common-hal/alarm/__init__.c +++ b/ports/stm/common-hal/alarm/__init__.c @@ -31,6 +31,7 @@ #include "lib/utils/interrupt_char.h" #include "shared-bindings/alarm/__init__.h" +#include "shared-bindings/alarm/SleepMemory.h" #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/alarm/time/TimeAlarm.h" @@ -39,6 +40,13 @@ #include "supervisor/port.h" #include "supervisor/shared/workflow.h" +// Singleton instance of SleepMemory. +const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { + .base = { + .type = &alarm_sleep_memory_type, + }, +}; + STATIC uint8_t true_deep_wake_reason; STATIC mp_obj_t most_recent_alarm; diff --git a/ports/stm/common-hal/alarm/__init__.h b/ports/stm/common-hal/alarm/__init__.h index 0bfafbcee2..5f1532fc37 100644 --- a/ports/stm/common-hal/alarm/__init__.h +++ b/ports/stm/common-hal/alarm/__init__.h @@ -29,7 +29,7 @@ #include "common-hal/alarm/SleepMemory.h" -const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; +extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; #define STM_WAKEUP_UNDEF 0 #define STM_WAKEUP_GPIO 1