From d7365495aaf187437132cdb0f54bf46d639701b6 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sat, 23 Apr 2022 17:58:33 +0200 Subject: [PATCH] spiFlash: fix display: when bp_len==0 -> set bp/tb = 0, otherwise parse reg --- src/spiFlash.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/spiFlash.cpp b/src/spiFlash.cpp index a0489fe..44c3f9a 100644 --- a/src/spiFlash.cpp +++ b/src/spiFlash.cpp @@ -478,6 +478,9 @@ void SPIFlash::display_status_reg(uint8_t reg) tb = (reg >> 5) & 0x01; bp = (((reg >> 6) & 0x01) << 3) | ((reg >> 2) & 0x07); } else if (_flash_model->bp_len == 0) { + tb = 0; + bp = 0; + } else { tb = (reg & _flash_model->tb_offset) ? 1 : 0; bp = 0; for (int i = 0; i < _flash_model->bp_len; i++)