From 1e12c57bbad8a6dadbf34bb2cc1c50070936e341 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 28 Nov 2020 10:31:24 +0900 Subject: [PATCH] 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 078fe7b2d05..dfc44509d65 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;