Skip to content

Commit 3ad6b30

Browse files
authored
[componects] 修复不能发现禁止写spi flash失败的情形
`(register_status & SFUD_STATUS_REGISTER_WEL) == 1` 这个表达式始终为假 SFUD_STATUS_REGISTER_WEL = (1 << 1)
1 parent c232235 commit 3ad6b30

File tree

1 file changed

+1
-1
lines changed
  • components/drivers/spi/sfud/src

1 file changed

+1
-1
lines changed

components/drivers/spi/sfud/src/sfud.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ static sfud_err set_write_enabled(const sfud_flash *flash, bool enabled) {
897897
if (enabled && (register_status & SFUD_STATUS_REGISTER_WEL) == 0) {
898898
SFUD_INFO("Error: Can't enable write status.");
899899
return SFUD_ERR_WRITE;
900-
} else if (!enabled && (register_status & SFUD_STATUS_REGISTER_WEL) == 1) {
900+
} else if (!enabled && (register_status & SFUD_STATUS_REGISTER_WEL) != 0) {
901901
SFUD_INFO("Error: Can't disable write status.");
902902
return SFUD_ERR_WRITE;
903903
}

0 commit comments

Comments
 (0)