From db410839afdeaa5a410c0559e27b6c03c310031b Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sat, 30 Apr 2022 20:16:30 +0200 Subject: [PATCH] spiInterface: unprotect_flash: fix return. Improve messages --- src/spiInterface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spiInterface.cpp b/src/spiInterface.cpp index d5c606b..f346fc7 100644 --- a/src/spiInterface.cpp +++ b/src/spiInterface.cpp @@ -55,11 +55,10 @@ bool SPIInterface::protect_flash(uint32_t len) bool SPIInterface::unprotect_flash() { bool ret = true; - printInfo("unprotect_flash: ", false); /* move device to spi access */ if (!prepare_flash_access()) { - printError("Fail"); + printError("SPI Flash prepare access failed"); return false; } @@ -68,13 +67,14 @@ bool SPIInterface::unprotect_flash() SPIFlash flash(this, false, _spif_verbose); /* configure flash protection */ - ret = flash.disable_protection() != 0; + printInfo("unprotect_flash: ", false); + ret = (flash.disable_protection() == 0); if (!ret) printError("Fail " + std::to_string(ret)); else printSuccess("Done"); } catch (std::exception &e) { - printError("Fail"); + printError("SPI Flash access failed: ", false); printError(e.what()); ret = false; }