diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-05-12 21:42:06 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-05-12 21:42:06 -0600 |
commit | 1a02c15166a34eb61a272f20d024af38e8e10bf7 (patch) | |
tree | 2b67187eeaf964c72f74fb1ac06d5cc36bd87bda | |
parent | b0ae31a3651e8655669416e25cec9ff5433fa080 (diff) | |
download | nuttx-1a02c15166a34eb61a272f20d024af38e8e10bf7.tar.gz nuttx-1a02c15166a34eb61a272f20d024af38e8e10bf7.tar.bz2 nuttx-1a02c15166a34eb61a272f20d024af38e8e10bf7.zip |
A fix to the last MB85RS1MT patch
-rw-r--r-- | nuttx/drivers/mtd/ramtron.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nuttx/drivers/mtd/ramtron.c b/nuttx/drivers/mtd/ramtron.c index 2ced81238..403867cd2 100644 --- a/nuttx/drivers/mtd/ramtron.c +++ b/nuttx/drivers/mtd/ramtron.c @@ -333,18 +333,23 @@ static inline int ramtron_readid(struct ramtron_dev_s *priv) ramtron_lock(priv->dev); SPI_SELECT(priv->dev, SPIDEV_FLASH, true); - /* Send the "Read ID (RDID)" command and read the first three ID bytes */ + /* Send the "Read ID (RDID)" command */ (void)SPI_SEND(priv->dev, RAMTRON_RDID); + + /* Read the first six manufacturer ID bytes. */ + for (i = 0; i < 6; i++) { + /* Read the next manufacturer byte */ + manufacturer = SPI_SEND(priv->dev, RAMTRON_DUMMY); /* Fujitsu parts such as MB85RS1MT only have 1-byte for the manufacturer * ID. The manufacturer code is "0x4". */ - if (manufacturer == 0x04) + if (i == 0 && manufacturer == 0x04) { break; } |