ESP8266 RTC Memory (Arduino IDE)
Posted: Mon Feb 12, 2018 1:27 pm
I'm running into some weird issues with RTC memory. Here's my initialization stuff above setup():
And here's a line that works:
This also works to store one variable starting at bucket 64:
However, the problem is storing an individual variable from RTCvals at any other bucket number, like 65 or 66:
The line above will print "FAILED!". I'm also pretty sure it used to work before, so I'm a bit baffled. Any ideas what's going on here?
Thanks!
Code: Select all
extern "C" {
#include "user_interface.h"
}
typedef struct {
boolean var1 = false;
uint8_t var2 = 0;
uint8_t var3 = 0;
} rtcStore;
rtcStore RTCvals;
And here's a line that works:
Code: Select all
system_rtc_mem_write(64, &RTCvals, sizeof(RTCvals));
This also works to store one variable starting at bucket 64:
Code: Select all
system_rtc_mem_write(64, &RTCvals.var1, 4);
However, the problem is storing an individual variable from RTCvals at any other bucket number, like 65 or 66:
Code: Select all
if (!system_rtc_mem_write(65, &RTCvals.var2, 4)) Serial.println("FAILED!");
The line above will print "FAILED!". I'm also pretty sure it used to work before, so I'm a bit baffled. Any ideas what's going on here?
Thanks!