From d5261c997a146b6d8eb6c5f296ee96fd3f8c97b6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 3 Jun 2012 16:09:59 +0000 Subject: [PATCH] SD card now works on the PIC32MX7 MMB board git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4799 42af7a65-404d-4744-a932-0658087f49c3 --- arch/mips/src/pic32mx/pic32mx-spi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/mips/src/pic32mx/pic32mx-spi.c b/arch/mips/src/pic32mx/pic32mx-spi.c index ee7cea9eb2..7bc1eee3e8 100644 --- a/arch/mips/src/pic32mx/pic32mx-spi.c +++ b/arch/mips/src/pic32mx/pic32mx-spi.c @@ -64,7 +64,7 @@ * Definitions ****************************************************************************/ /* Enables non-standard debug output from this file. - * + * * CONFIG_SPI_DEBUG && CONFIG_DEBUG - Define to enable basic SPI debug * CONFIG_DEBUG_VERBOSE - Define to enable verbose SPI debug */ @@ -527,7 +527,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) } /* Save the new BRG value */ - + spi_putreg(priv, PIC32MX_SPI_BRG_OFFSET, regval); spivdbg("PBCLOCK: %d frequency: %d divisor: %d BRG: %d\n", BOARD_PBCLOCK, frequency, divisor, regval); @@ -619,19 +619,19 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) { case SPIDEV_MODE0: /* CPOL=0; CPHA=0 */ break; - + case SPIDEV_MODE1: /* CPOL=0; CPHA=1 */ regval |= SPI_CON_CKE; break; - + case SPIDEV_MODE2: /* CPOL=1; CPHA=0 */ regval |= SPI_CON_CKP; break; - + case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ regval |= (SPI_CON_CKP|SPI_CON_CKE); break; - + default: DEBUGASSERT(FALSE); return; @@ -866,7 +866,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw while ((spi_getreg(priv, PIC32MX_SPI_STAT_OFFSET) & SPI_STAT_SPIRBF) == 0); #endif - /* Read the received data from the SPI Data Register */ + /* Read the received data from the SPI Data Register */ *ptr++ = (uint8_t)spi_getreg(priv, PIC32MX_SPI_BUF_OFFSET); nwords--; @@ -950,7 +950,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port) /* Clear the receive buffer by reading from the BUF register */ regval = spi_getreg(priv, PIC32MX_SPI_BUF_OFFSET); - + #ifdef CONFIG_PIC32MX_SPI_INTERRUPTS /* Attach the interrupt vector. We do this early to make sure that the * resource is available.