Merge pull request #2847 from bd34n/external-flash-fix
.../external_flash.c: Don't attempt to issue CMD_READ_STATUS2 for devices with only a single_status_byte.
This commit is contained in:
commit
54eb6d39e4
|
@ -218,11 +218,12 @@ void supervisor_flash_init(void) {
|
|||
do {
|
||||
spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1);
|
||||
} while ((read_status_response[0] & 0x1) != 0);
|
||||
// The suspended write/erase bit should be low.
|
||||
do {
|
||||
if (!flash_device->single_status_byte) {
|
||||
// The suspended write/erase bit should be low.
|
||||
do {
|
||||
spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1);
|
||||
} while ((read_status_response[0] & 0x80) != 0);
|
||||
|
||||
} while ((read_status_response[0] & 0x80) != 0);
|
||||
}
|
||||
|
||||
spi_flash_command(CMD_ENABLE_RESET);
|
||||
spi_flash_command(CMD_RESET);
|
||||
|
|
Loading…
Reference in New Issue