From 176444320c3c32bd35180ffcdbbda7be0cfd23bc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 10 Nov 2009 22:13:59 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1281 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/io/platforms/STM32/spi_lld.c | 15 ++++++++------- os/io/platforms/STM32/spi_lld.h | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'os/io/platforms') diff --git a/os/io/platforms/STM32/spi_lld.c b/os/io/platforms/STM32/spi_lld.c index b92dafe6e..087319c5d 100644 --- a/os/io/platforms/STM32/spi_lld.c +++ b/os/io/platforms/STM32/spi_lld.c @@ -61,7 +61,7 @@ static void spi_stop(SPIDriver *spip) { } static void spi_start_wait(SPIDriver *spip, size_t n, - void *rxbuf, void *txbuf) { + const void *txbuf, void *rxbuf) { uint32_t ccr; /* Common DMA setup.*/ @@ -294,7 +294,7 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { spip->spd_dmarx->CCR = DMA_CCR1_TCIE | DMA_CCR1_TEIE; spip->spd_dmatx->CCR = DMA_CCR1_DIR | DMA_CCR1_TEIE; - spi_start_wait(spip, n, &dummyrx, &dummytx); + spi_start_wait(spip, n, &dummytx, &dummyrx); } /** @@ -309,11 +309,12 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { * @note The buffers are organized as uint8_t arrays for data sizes below or * equal to 8 bits else it is organized as uint16_t arrays. */ -void spi_lld_exchange(SPIDriver *spip, size_t n, void *txbuf, void *rxbuf) { +void spi_lld_exchange(SPIDriver *spip, size_t n, + const void *txbuf, void *rxbuf) { spip->spd_dmarx->CCR = DMA_CCR1_TCIE | DMA_CCR1_MINC | DMA_CCR1_TEIE; spip->spd_dmatx->CCR = DMA_CCR1_DIR | DMA_CCR1_MINC | DMA_CCR1_TEIE; - spi_start_wait(spip, n, rxbuf, txbuf); + spi_start_wait(spip, n, txbuf, rxbuf); } /** @@ -326,11 +327,11 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, void *txbuf, void *rxbuf) { * @note The buffers are organized as uint8_t arrays for data sizes below or * equal to 8 bits else it is organized as uint16_t arrays. */ -void spi_lld_send(SPIDriver *spip, size_t n, void *txbuf) { +void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { spip->spd_dmarx->CCR = DMA_CCR1_TCIE | DMA_CCR1_TEIE; spip->spd_dmatx->CCR = DMA_CCR1_DIR | DMA_CCR1_MINC | DMA_CCR1_TEIE; - spi_start_wait(spip, n, &dummyrx, txbuf); + spi_start_wait(spip, n, txbuf, &dummyrx); } /** @@ -347,7 +348,7 @@ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { spip->spd_dmarx->CCR = DMA_CCR1_TCIE | DMA_CCR1_MINC | DMA_CCR1_TEIE; spip->spd_dmatx->CCR = DMA_CCR1_DIR | DMA_CCR1_TEIE; - spi_start_wait(spip, n, rxbuf, &dummytx); + spi_start_wait(spip, n, &dummytx, rxbuf); } /** @} */ diff --git a/os/io/platforms/STM32/spi_lld.h b/os/io/platforms/STM32/spi_lld.h index 54dcbfff3..a6041f060 100644 --- a/os/io/platforms/STM32/spi_lld.h +++ b/os/io/platforms/STM32/spi_lld.h @@ -186,8 +186,9 @@ extern "C" { void spi_lld_select(SPIDriver *spip); void spi_lld_unselect(SPIDriver *spip); void spi_lld_ignore(SPIDriver *spip, size_t n); - void spi_lld_exchange(SPIDriver *spip, size_t n, void *txbuf, void *rxbuf); - void spi_lld_send(SPIDriver *spip, size_t n, void *txbuf); + void spi_lld_exchange(SPIDriver *spip, size_t n, + const void *txbuf, void *rxbuf); + void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf); void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf); #ifdef __cplusplus } -- cgit v1.2.3