Skip to content

Commit 1f3d69d

Browse files
committed
Clean up sleep memory, mark as not-implemented
1 parent b6a268f commit 1f3d69d

File tree

3 files changed

+5
-35
lines changed

3 files changed

+5
-35
lines changed

locale/circuitpython.pot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,7 @@ msgstr ""
20262026
msgid "Size not supported"
20272027
msgstr ""
20282028

2029+
#: ports/raspberrypi/common-hal/alarm/SleepMemory.c
20292030
#: ports/stm/common-hal/alarm/SleepMemory.c
20302031
msgid "Sleep Memory not available"
20312032
msgstr ""

ports/raspberrypi/common-hal/alarm/SleepMemory.c

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,19 @@
2929
#include "py/runtime.h"
3030
#include "common-hal/alarm/SleepMemory.h"
3131

32-
// Data storage for singleton instance of SleepMemory.
33-
// Might be RTC_SLOW_MEM or RTC_FAST_MEM, depending on setting of CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM.
34-
// static RTC_DATA_ATTR uint8_t _sleep_mem[SLEEP_MEMORY_LENGTH];
35-
3632
void alarm_sleep_memory_reset(void) {
37-
// ESP-IDF build system takes care of doing esp_sleep_pd_config() or the equivalentwith
38-
// the correct settings, depending on which RTC mem we are using.
39-
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/system/sleep_modes.html#power-down-of-rtc-peripherals-and-memories
4033
}
4134

4235
uint32_t common_hal_alarm_sleep_memory_get_length(alarm_sleep_memory_obj_t *self) {
43-
return 0;// sizeof(_sleep_mem);
36+
mp_raise_NotImplementedError(translate("Sleep Memory not available"));
37+
return 0;
4438
}
4539

4640
bool common_hal_alarm_sleep_memory_set_bytes(alarm_sleep_memory_obj_t *self, uint32_t start_index, const uint8_t *values, uint32_t len) {
47-
48-
// if (start_index + len > sizeof(_sleep_mem)) {
49-
// return false;
50-
// }
51-
52-
// memcpy((uint8_t *)(_sleep_mem + start_index), values, len);
53-
// return true;
41+
mp_raise_NotImplementedError(translate("Sleep Memory not available"));
5442
return false;
5543
}
5644

5745
void common_hal_alarm_sleep_memory_get_bytes(alarm_sleep_memory_obj_t *self, uint32_t start_index, uint8_t *values, uint32_t len) {
58-
59-
// if (start_index + len > sizeof(_sleep_mem)) {
60-
// return;
61-
// }
62-
// memcpy(values, (uint8_t *)(_sleep_mem + start_index), len);
46+
mp_raise_NotImplementedError(translate("Sleep Memory not available"));
6347
}

ports/raspberrypi/common-hal/alarm/SleepMemory.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@
2929

3030
#include "py/obj.h"
3131

32-
// There are several places we could store persistent data for SleepMemory:
33-
//
34-
// RTC registers: There are a few 32-bit registers maintained during deep sleep.
35-
// We are already using one for saving sleep information during deep sleep.
36-
//
37-
// RTC Fast Memory: 8kB, also used for deep-sleep power-on stub.
38-
// RTC Slow Memory: 8kB, also used for the ULP (tiny co-processor available during sleep).
39-
//
40-
// The ESP-IDF build system takes care of the power management of these regions.
41-
// RTC_DATA_ATTR will allocate storage in RTC_SLOW_MEM unless CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM
42-
// is set. Any memory not allocated by us can be used by the ESP-IDF for heap or other purposes.
43-
44-
// Use half of RTC_SLOW_MEM or RTC_FAST_MEM.
45-
#define SLEEP_MEMORY_LENGTH (4096)
46-
4732
typedef struct {
4833
mp_obj_base_t base;
4934
} alarm_sleep_memory_obj_t;

0 commit comments

Comments
 (0)