diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c b/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c index 821688d51..6be5df7bd 100644 --- a/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c +++ b/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c @@ -342,15 +342,6 @@ void i2s_lld_start(I2SDriver *i2sp) { #endif
}
#endif
-
- if (NULL != i2sp->dmarx) {
- dmaStreamSetMode(i2sp->dmarx, i2sp->rxdmamode);
- dmaStreamSetPeripheral(i2sp->dmarx, &i2sp->spi->DR);
- }
- if (NULL != i2sp->dmatx) {
- dmaStreamSetMode(i2sp->dmatx, i2sp->txdmamode);
- dmaStreamSetPeripheral(i2sp->dmatx, &i2sp->spi->DR);
- }
}
/* I2S (re)configuration.*/
@@ -412,6 +403,8 @@ void i2s_lld_start_exchange(I2SDriver *i2sp) { /* RX DMA setup.*/
if (NULL != i2sp->dmarx) {
+ dmaStreamSetMode(i2sp->dmarx, i2sp->rxdmamode);
+ dmaStreamSetPeripheral(i2sp->dmarx, &i2sp->spi->DR);
dmaStreamSetMemory0(i2sp->dmarx, i2sp->config->rx_buffer);
dmaStreamSetTransactionSize(i2sp->dmarx, size);
dmaStreamEnable(i2sp->dmarx);
@@ -419,6 +412,8 @@ void i2s_lld_start_exchange(I2SDriver *i2sp) { /* TX DMA setup.*/
if (NULL != i2sp->dmatx) {
+ dmaStreamSetMode(i2sp->dmatx, i2sp->txdmamode);
+ dmaStreamSetPeripheral(i2sp->dmatx, &i2sp->spi->DR);
dmaStreamSetMemory0(i2sp->dmatx, i2sp->config->tx_buffer);
dmaStreamSetTransactionSize(i2sp->dmatx, size);
dmaStreamEnable(i2sp->dmatx);
|