- Tue Apr 26, 2016 5:32 am
#46218
martinayotte wrote:Any RAM on any MCU has random values at power-up.
Maybe your code should looks for some "magic" numbers around your data structure, and maybe even a CRC, then the code would make the differences between real wakeup and power-on state.
Well, I didn't want to go this way x)
What I did was to check the value stored in 68th slot (68 being a random number I picked). Is this value higher than 1, which is almost always the case, it turns ON a LED on GPIO12, initiates RTC as I wish it to be, stores the value 0 on 68th slot, delay(2000), and then goes into deepsleep for one second. On the next wakeup, 68th on RTC is checked again, if it's equal to 0, it goes into its normal duty cycles.
If 68th has the value 0 when I first powerit up, I'd notice that ; the LED wouldn't be ON.
I know, that's a very lazy way to solve the "problem"