spiFlash: fix display: when bp_len==0 -> set bp/tb = 0, otherwise parse reg

This commit is contained in:
Gwenhael Goavec-Merou 2022-04-23 17:58:33 +02:00
parent 5692482152
commit d7365495aa
1 changed files with 3 additions and 0 deletions

View File

@ -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++)