Clean up sleep memory, mark as not-implemented

This commit is contained in:
Lucian Copeland 2021-06-20 17:57:51 -04:00
parent b6a268fca4
commit 1f3d69d87c
3 changed files with 5 additions and 35 deletions

View File

@ -2026,6 +2026,7 @@ msgstr ""
msgid "Size not supported"
msgstr ""
#: ports/raspberrypi/common-hal/alarm/SleepMemory.c
#: ports/stm/common-hal/alarm/SleepMemory.c
msgid "Sleep Memory not available"
msgstr ""

View File

@ -29,35 +29,19 @@
#include "py/runtime.h"
#include "common-hal/alarm/SleepMemory.h"
// Data storage for singleton instance of SleepMemory.
// Might be RTC_SLOW_MEM or RTC_FAST_MEM, depending on setting of CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM.
// static RTC_DATA_ATTR uint8_t _sleep_mem[SLEEP_MEMORY_LENGTH];
void alarm_sleep_memory_reset(void) {
// ESP-IDF build system takes care of doing esp_sleep_pd_config() or the equivalentwith
// the correct settings, depending on which RTC mem we are using.
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/system/sleep_modes.html#power-down-of-rtc-peripherals-and-memories
}
uint32_t common_hal_alarm_sleep_memory_get_length(alarm_sleep_memory_obj_t *self) {
return 0;// sizeof(_sleep_mem);
mp_raise_NotImplementedError(translate("Sleep Memory not available"));
return 0;
}
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) {
// if (start_index + len > sizeof(_sleep_mem)) {
// return false;
// }
// memcpy((uint8_t *)(_sleep_mem + start_index), values, len);
// return true;
mp_raise_NotImplementedError(translate("Sleep Memory not available"));
return false;
}
void common_hal_alarm_sleep_memory_get_bytes(alarm_sleep_memory_obj_t *self, uint32_t start_index, uint8_t *values, uint32_t len) {
// if (start_index + len > sizeof(_sleep_mem)) {
// return;
// }
// memcpy(values, (uint8_t *)(_sleep_mem + start_index), len);
mp_raise_NotImplementedError(translate("Sleep Memory not available"));
}

View File

@ -29,21 +29,6 @@
#include "py/obj.h"
// There are several places we could store persistent data for SleepMemory:
//
// RTC registers: There are a few 32-bit registers maintained during deep sleep.
// We are already using one for saving sleep information during deep sleep.
//
// RTC Fast Memory: 8kB, also used for deep-sleep power-on stub.
// RTC Slow Memory: 8kB, also used for the ULP (tiny co-processor available during sleep).
//
// The ESP-IDF build system takes care of the power management of these regions.
// RTC_DATA_ATTR will allocate storage in RTC_SLOW_MEM unless CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM
// is set. Any memory not allocated by us can be used by the ESP-IDF for heap or other purposes.
// Use half of RTC_SLOW_MEM or RTC_FAST_MEM.
#define SLEEP_MEMORY_LENGTH (4096)
typedef struct {
mp_obj_base_t base;
} alarm_sleep_memory_obj_t;