You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/12/06 15:03:36 UTC

[incubator-nuttx] 17/18: boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c: Don't assume debug macro expansion

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1e12c57bbad8a6dadbf34bb2cc1c50070936e341
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Nov 28 10:31:24 2020 +0900

    boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c: Don't assume debug macro expansion
---
 boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c b/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c
index 078fe7b..dfc4450 100644
--- a/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c
+++ b/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c
@@ -237,16 +237,20 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid,
       /* Enable slave select (low enables) */
 
       putreg32(bit, CS_CLR_REGISTER);
+#ifdef CONFIG_DEBUG_SPI_INFO
       spiinfo("CS asserted: %08" PRIx32 "->%08" PRIx32 "\n",
               regval, getreg32(CS_PIN_REGISTER));
+#endif
     }
   else
     {
       /* Disable slave select (low enables) */
 
       putreg32(bit, CS_SET_REGISTER);
+#ifdef CONFIG_DEBUG_SPI_INFO
       spiinfo("CS de-asserted: %08" PRIx32 "->%08" PRIx32 "\n", regval,
                getreg32(CS_PIN_REGISTER));
+#endif
 
       /* Wait for the TX FIFO not full indication */
 
@@ -382,16 +386,20 @@ static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
       /* L: the inputs at D0 to D7 are transferred to the command registers */
 
       putreg32(bit, CS_CLR_REGISTER);
+#ifdef CONFIG_DEBUG_SPI_INFO
       spiinfo("Command: %08" PRIx32 "->%08" PRIx32 "\n",
               regval, getreg32(CS_PIN_REGISTER));
+#endif
     }
   else
     {
       /* H: the inputs at D0 to D7 are treated as display data. */
 
       putreg32(bit, CS_SET_REGISTER);
+#ifdef CONFIG_DEBUG_SPI_INFO
       spiinfo("Data: %08" PRIx32 "->%08" PRIx32 "\n",
               regval, getreg32(CS_PIN_REGISTER));
+#endif
     }
 
   return OK;