Skip to content

Commit 07b86fc

Browse files
committed
fix sleepmemory object redefine error
1 parent bab5a22 commit 07b86fc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ports/stm/common-hal/alarm/__init__.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "lib/utils/interrupt_char.h"
3232

3333
#include "shared-bindings/alarm/__init__.h"
34+
#include "shared-bindings/alarm/SleepMemory.h"
3435
#include "shared-bindings/alarm/pin/PinAlarm.h"
3536
#include "shared-bindings/alarm/time/TimeAlarm.h"
3637

@@ -39,6 +40,13 @@
3940
#include "supervisor/port.h"
4041
#include "supervisor/shared/workflow.h"
4142

43+
// Singleton instance of SleepMemory.
44+
const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = {
45+
.base = {
46+
.type = &alarm_sleep_memory_type,
47+
},
48+
};
49+
4250
STATIC uint8_t true_deep_wake_reason;
4351
STATIC mp_obj_t most_recent_alarm;
4452

ports/stm/common-hal/alarm/__init__.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include "common-hal/alarm/SleepMemory.h"
3131

32-
const alarm_sleep_memory_obj_t alarm_sleep_memory_obj;
32+
extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj;
3333

3434
#define STM_WAKEUP_UNDEF 0
3535
#define STM_WAKEUP_GPIO 1

0 commit comments

Comments
 (0)