Skip to content

Commit

Permalink
Fix LowPowerDemo.ino (#8841)
Browse files Browse the repository at this point in the history
CRC checking of data read from RTC was always true
  • Loading branch information
GrzegorzWo committed Feb 1, 2023
1 parent 6dfebec commit 1beca6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void setup() {

// Read previous resets (Deep Sleeps) from RTC memory, if any
uint32_t crcOfData = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake")) {
if ((crcOfData == nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake")) {
resetCount = nv->rtcData.rstCount; // read the previous reset count
resetCount++;
}
Expand Down

0 comments on commit 1beca6f

Please sign in to comment.