Fix ENC28J60 chip enable issue

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5153 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-09-14 20:16:06 +00:00
parent 2c2ba7f0c5
commit 7c82cf6924
8 changed files with 128 additions and 76 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* drivers/mtd/m25px.c
* drivers/mtd/sst25.c
* Driver for SPI-based SST25 FLASH.
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
+6 -6
View File
@@ -652,14 +652,14 @@ static uint8_t enc_rdbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg)
DEBUGASSERT(priv && priv->spi);
/* Select ENC28J60 chip */
enc_select(priv);
/* Set the bank */
enc_setbank(priv, GETBANK(ctrlreg));
/* Select ENC28J60 chip */
enc_select(priv);
/* Send the RCR command and collect the data. How we collect the data
* depends on if this is a PHY/CAN or not. The normal sequence requires
* 16-clocks: 8 to clock out the cmd and 8 to clock in the data.
@@ -672,10 +672,10 @@ static uint8_t enc_rdbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg)
* 8 dummy bits, and 8 to clock in the PHY/MAC data.
*/
(void)SPI_SEND(priv->spi, 0); /* Clock in the dummy byte */
(void)SPI_SEND(priv->spi, 0); /* Clock in the dummy byte */
}
rddata = SPI_SEND(priv->spi, 0); /* Clock in the data */
rddata = SPI_SEND(priv->spi, 0); /* Clock in the data */
/* De-select ENC28J60 chip */