nrf52 spi: build fixes for !SPI_EXCHANGE

This commit is contained in:
Matias N 2020-09-23 13:36:17 -03:00 committed by Alan Carvalho de Assis
parent 4665a3d648
commit 0f9fb67b0c

View File

@ -172,8 +172,8 @@ static const struct spi_ops_s g_spi0ops =
# ifdef CONFIG_SPI_EXCHANGE # ifdef CONFIG_SPI_EXCHANGE
.exchange = nrf52_spi_exchange, .exchange = nrf52_spi_exchange,
# else # else
.sendlock = nrf52_spi_sendblock, .sndblock = nrf52_spi_sndblock,
.recvblock = nrf52_spi_recvblock .recvblock = nrf52_spi_recvblock,
# endif # endif
#ifdef CONFIG_SPI_TRIGGER #ifdef CONFIG_SPI_TRIGGER
.trigger = nrf52_spi_trigger, .trigger = nrf52_spi_trigger,
@ -181,7 +181,7 @@ static const struct spi_ops_s g_spi0ops =
#ifdef CONFIG_SPI_CALLBACK #ifdef CONFIG_SPI_CALLBACK
.registercallback = nrf52_spi0register, /* Provided externally */ .registercallback = nrf52_spi0register, /* Provided externally */
#else #else
.registercallback = 0, /* Not implemented */ .registercallback = NULL, /* Not implemented */
#endif #endif
}; };
@ -225,8 +225,8 @@ static const struct spi_ops_s g_spi1ops =
# ifdef CONFIG_SPI_EXCHANGE # ifdef CONFIG_SPI_EXCHANGE
.exchange = nrf52_spi_exchange, .exchange = nrf52_spi_exchange,
# else # else
.sendlock = nrf52_spi_sendblock, .sndlock = nrf52_spi_sndblock,
.recvblock = nrf52_spi_recvblock .recvblock = nrf52_spi_recvblock,
# endif # endif
#ifdef CONFIG_SPI_TRIGGER #ifdef CONFIG_SPI_TRIGGER
.trigger = nrf52_spi_trigger, .trigger = nrf52_spi_trigger,
@ -234,7 +234,7 @@ static const struct spi_ops_s g_spi1ops =
#ifdef CONFIG_SPI_CALLBACK #ifdef CONFIG_SPI_CALLBACK
.registercallback = nrf52_spi1register, /* Provided externally */ .registercallback = nrf52_spi1register, /* Provided externally */
#else #else
.registercallback = 0, /* Not implemented */ .registercallback = NULL, /* Not implemented */
#endif #endif
}; };
@ -278,8 +278,8 @@ static const struct spi_ops_s g_spi2ops =
# ifdef CONFIG_SPI_EXCHANGE # ifdef CONFIG_SPI_EXCHANGE
.exchange = nrf52_spi_exchange, .exchange = nrf52_spi_exchange,
# else # else
.sendlock = nrf52_spi_sendblock, .sndlock = nrf52_spi_sndblock,
.recvblock = nrf52_spi_recvblock .recvblock = nrf52_spi_recvblock,
# endif # endif
#ifdef CONFIG_SPI_TRIGGER #ifdef CONFIG_SPI_TRIGGER
.trigger = nrf52_spi_trigger, .trigger = nrf52_spi_trigger,
@ -287,7 +287,7 @@ static const struct spi_ops_s g_spi2ops =
#ifdef CONFIG_SPI_CALLBACK #ifdef CONFIG_SPI_CALLBACK
.registercallback = nrf52_spi2register, /* Provided externally */ .registercallback = nrf52_spi2register, /* Provided externally */
#else #else
.registercallback = 0, /* Not implemented */ .registercallback = NULL, /* Not implemented */
#endif #endif
}; };
@ -331,8 +331,8 @@ static const struct spi_ops_s g_spi3ops =
# ifdef CONFIG_SPI_EXCHANGE # ifdef CONFIG_SPI_EXCHANGE
.exchange = nrf52_spi_exchange, .exchange = nrf52_spi_exchange,
# else # else
.sendlock = nrf52_spi_sendblock, .sndlock = nrf52_spi_sndblock,
.recvblock = nrf52_spi_recvblock .recvblock = nrf52_spi_recvblock,
# endif # endif
#ifdef CONFIG_SPI_TRIGGER #ifdef CONFIG_SPI_TRIGGER
.trigger = nrf52_spi_trigger, .trigger = nrf52_spi_trigger,
@ -340,7 +340,7 @@ static const struct spi_ops_s g_spi3ops =
#ifdef CONFIG_SPI_CALLBACK #ifdef CONFIG_SPI_CALLBACK
.registercallback = nrf52_spi3register, /* Provided externally */ .registercallback = nrf52_spi3register, /* Provided externally */
#else #else
.registercallback = 0, /* Not implemented */ .registercallback = NULL, /* Not implemented */
#endif #endif
}; };
@ -1057,7 +1057,7 @@ static void nrf52_spi_recvblock(FAR struct spi_dev_s *dev,
size_t nwords) size_t nwords)
{ {
spiinfo("txbuffer=%p nwords=%d\n", txbuffer, nwords); spiinfo("txbuffer=%p nwords=%d\n", txbuffer, nwords);
return nrf52_spi_exchange(dev, txbuffer, NULL, nwords); return nrf52_spi_exchange(dev, rxbuffer, NULL, nwords);
} }
#endif /* CONFIG_SPI_EXCHANGE */ #endif /* CONFIG_SPI_EXCHANGE */