From 9d609af54c63e7f949a4fbc43d4f1c13b57f49d8 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 10 Jul 2018 08:25:43 +0300 Subject: [PATCH] Added check for version after write. --- components/wear_levelling/WL_Flash.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/wear_levelling/WL_Flash.cpp b/components/wear_levelling/WL_Flash.cpp index 9e738bb240..a2b42261cd 100644 --- a/components/wear_levelling/WL_Flash.cpp +++ b/components/wear_levelling/WL_Flash.cpp @@ -385,6 +385,12 @@ esp_err_t WL_Flash::updateV1_V2() WL_RESULT_CHECK(result); ESP_LOGD(TAG, "%s - move_count= 0x%08x, pos= 0x%08x", __func__, this->state.move_count, this->state.pos); + result = this->flash_drv->read(this->addr_state1, &this->state, sizeof(wl_state_t)); + WL_RESULT_CHECK(result); + ESP_LOGI(TAG, "%s update result ver=%i, pos=%i", __func__, (uint32_t)this->state.version, (uint32_t)this->state.pos); + + + memset(this->temp_buff, 0, this->cfg.wr_size); for (uint32_t i=0 ; i<= pos; i++) { this->fillOkBuff(i); -- 2.40.0