Silabs: SPI DMA fix

DMA tranfer was not working in Geckos using DMA. Changed transfer
length calculation in function spi_activate_dma.
pull/1501/head
jhokajar 2015-12-01 14:14:13 +02:00 committed by Steven Cooreman
parent 0dfca1ad86
commit 2160134d48
1 changed files with 2 additions and 2 deletions

View File

@ -1006,7 +1006,7 @@ static void spi_activate_dma(spi_t *obj, void* rxdata, const void* txdata, int t
false,
(obj->spi.bits <= 8 ? (void *)&(obj->spi.spi->TXDATA) : (void *)&(obj->spi.spi->TXDOUBLE)), //When frame size > 9, point to TXDOUBLE
(txdata == 0 ? &fill_word : (void *)txdata), // When there is nothing to transmit, point to static fill word
(obj->spi.bits <= 8 ? tx_length - 1 : (tx_length / 2) - 1)); // When using TXDOUBLE, recalculate transfer length
(tx_length - 1));
} else {
/* Frame size == 9 */
/* Only activate RX DMA if a receive buffer is specified */
@ -1044,7 +1044,7 @@ static void spi_activate_dma(spi_t *obj, void* rxdata, const void* txdata, int t
false,
(void *)&(obj->spi.spi->TXDATAX), //When frame size > 9, point to TXDOUBLE
(txdata == 0 ? &fill_word : (void *)txdata), // When there is nothing to transmit, point to static fill word
(tx_length / 2) - 1); // When using TXDOUBLE, recalculate transfer length
(tx_length - 1));
}
}
#endif //LDMA_PRESENT