fix infinite loop bug when HIGH-Z MISO stays high (take2)

This commit is contained in:
LowPowerLab 2013-08-02 10:23:56 -04:00
parent 0efea19ac2
commit 7b054f770f
1 changed files with 5 additions and 2 deletions

View File

@ -62,9 +62,12 @@ 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 #if defined(__AVR_ATmega32U4__) // Arduino Leonardo, MoteinoLeo
command(SPIFLASH_IDREAD); // Read JEDEC ID
#else
select(); select();
SPI.transfer(SPIFLASH_IDREAD); SPI.transfer(SPIFLASH_IDREAD);
#endif
word jedecid = SPI.transfer(0) << 8; word jedecid = SPI.transfer(0) << 8;
jedecid |= SPI.transfer(0); jedecid |= SPI.transfer(0);
unselect(); unselect();
@ -204,4 +207,4 @@ void SPIFlash::wakeup() {
/// cleanup /// cleanup
void SPIFlash::end() { void SPIFlash::end() {
SPI.end(); SPI.end();
} }