mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 06:43:34 +08:00
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:
@@ -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.
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user