fix infinite loop bug when HIGH-Z MISO stays high
When FLASH chip is not present and MISO is in high impedance, other SPI devices might pull MISO high and the while(busy) loop might never return because of a false positive busy (actually MISO would return 0XFF for status register including the BUSY bit)
This commit is contained in:
parent
53156895f3
commit
0efea19ac2
|
|
@ -62,7 +62,9 @@ boolean SPIFlash::initialize()
|
||||||
/// Get the manufacturer and device ID bytes (as a short word)
|
/// Get the manufacturer and device ID bytes (as a short word)
|
||||||
word SPIFlash::readDeviceId()
|
word SPIFlash::readDeviceId()
|
||||||
{
|
{
|
||||||
command(SPIFLASH_IDREAD); // Read JEDEC ID
|
//command(SPIFLASH_IDREAD); // Read JEDEC ID
|
||||||
|
select();
|
||||||
|
SPI.transfer(SPIFLASH_IDREAD);
|
||||||
word jedecid = SPI.transfer(0) << 8;
|
word jedecid = SPI.transfer(0) << 8;
|
||||||
jedecid |= SPI.transfer(0);
|
jedecid |= SPI.transfer(0);
|
||||||
unselect();
|
unselect();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue