mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/mtd_spi_nor: fix poll on init
The while condition for polling the chip ID is broken, it will always poll for the max ammount of retries. Change the condition from `or` to `and` to fix the logic. fixes #15894
This commit is contained in:
parent
2991466cdd
commit
c1348c80a0
@ -393,7 +393,7 @@ static int mtd_spi_nor_power(mtd_dev_t *mtd, enum mtd_power_state power)
|
||||
xtimer_usleep(dev->params->wait_chip_wake_up);
|
||||
res = mtd_spi_read_jedec_id(dev, &dev->jedec_id);
|
||||
retries++;
|
||||
} while (res < 0 || retries < MTD_POWER_UP_WAIT_FOR_ID);
|
||||
} while (res < 0 && retries < MTD_POWER_UP_WAIT_FOR_ID);
|
||||
if (res < 0) {
|
||||
return -EIO;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user