Add missing nvs_flash_init() to ESP32 preferences code (#2805)

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
This commit is contained in:
Maurice Makaay 2021-11-26 21:25:58 +01:00 committed by Jesse Hills
parent 0cb715bb76
commit 57a029189c
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -76,6 +76,7 @@ class ESP32Preferences : public ESPPreferences {
uint32_t current_offset = 0;
void open() {
nvs_flash_init();
esp_err_t err = nvs_open("esphome", NVS_READWRITE, &nvs_handle);
if (err == 0)
return;