Skip to content

Commit

Permalink
esp32/machine_rtc.c: Optional MICROPY_HW_RTC_MEM_INIT_ALWAYS #define.
Browse files Browse the repository at this point in the history
  • Loading branch information
twenrich committed Dec 5, 2023
1 parent 37119e9 commit 2d47cab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ports/esp32/machine_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ typedef struct _machine_rtc_obj_t {
#define MICROPY_HW_RTC_USER_MEM_MAX 2048
#endif

#ifdef MICROPY_HW_RTC_USER_MEM_NOINIT
#define _USER_MEM_ATTR RTC_NOINIT_ATTR
#else
// Defaults to RTC_NOINIT_ATTR so the user memory survives WDT resets and the like.
#ifdef MICROPY_HW_RTC_MEM_INIT_ALWAYS
#define _USER_MEM_ATTR RTC_DATA_ATTR
#else
#define _USER_MEM_ATTR RTC_NOINIT_ATTR
#endif

// Optionally compile user memory functionality if the size of memory is greater than 0
Expand Down

0 comments on commit 2d47cab

Please sign in to comment.