From e98a49a691c9b27897c4505224ba788193e12fdb Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 11 Jul 2018 08:58:58 +0300 Subject: [PATCH] Position save included. --- components/wear_levelling/WL_Flash.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/wear_levelling/WL_Flash.cpp b/components/wear_levelling/WL_Flash.cpp index 6ba9c23092..9e738bb240 100644 --- a/components/wear_levelling/WL_Flash.cpp +++ b/components/wear_levelling/WL_Flash.cpp @@ -362,7 +362,7 @@ esp_err_t WL_Flash::updateV1_V2() WL_RESULT_CHECK(result); this->state.version = 2; - //this->state.pos = 0; + this->state.pos = 0; this->state.crc = crc32::crc32_le(WL_CFG_CRC_CONST, (uint8_t *)&this->state, offsetof(wl_state_t, crc)); this->state.device_id = esp_random(); memset(this->state.reserved, 0, sizeof(this->state.reserved)); @@ -391,6 +391,7 @@ esp_err_t WL_Flash::updateV1_V2() result = this->flash_drv->write(this->addr_state2 + sizeof(wl_state_t) + i * this->cfg.wr_size, this->temp_buff, this->cfg.wr_size); WL_RESULT_CHECK(result); } + this->state.pos = pos; return result; }