[componects] 修复不能发现禁止写spi flash失败的情形

`(register_status & SFUD_STATUS_REGISTER_WEL) == 1` 这个表达式始终为假

SFUD_STATUS_REGISTER_WEL = (1 << 1)
This commit is contained in:
zhaoshaowei 2019-12-27 16:52:52 +08:00 committed by GitHub
parent c2322353aa
commit 3ad6b30e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -897,7 +897,7 @@ static sfud_err set_write_enabled(const sfud_flash *flash, bool enabled) {
if (enabled && (register_status & SFUD_STATUS_REGISTER_WEL) == 0) {
SFUD_INFO("Error: Can't enable write status.");
return SFUD_ERR_WRITE;
} else if (!enabled && (register_status & SFUD_STATUS_REGISTER_WEL) == 1) {
} else if (!enabled && (register_status & SFUD_STATUS_REGISTER_WEL) != 0) {
SFUD_INFO("Error: Can't disable write status.");
return SFUD_ERR_WRITE;
}