mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 16:07:47 +01:00
Fix ESP8266 preference loading (#2367)
This commit is contained in:
parent
bbac1534a3
commit
c8a8acd46e
@ -149,7 +149,12 @@ class ESP8266PreferenceBackend : public ESPPreferenceBackend {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32_t crc = calculate_crc(buffer.begin(), buffer.end() - 1, type);
|
uint32_t crc = calculate_crc(buffer.begin(), buffer.end() - 1, type);
|
||||||
return buffer[buffer.size() - 1] == crc;
|
if (buffer[buffer.size() - 1] != crc) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(data, buffer.data(), len);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user