aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-01-02 11:43:13 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-01-02 11:43:13 +0000
commitd5635adecc959228fefce27610f211087fefd87f (patch)
treeda768fca6a17255b1d9b82fab19cc87e992340e3 /os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
parent60c04d66ec3c383febd9c9324e166aec2adb6e38 (diff)
downloadChibiOS-d5635adecc959228fefce27610f211087fefd87f.tar.gz
ChibiOS-d5635adecc959228fefce27610f211087fefd87f.tar.bz2
ChibiOS-d5635adecc959228fefce27610f211087fefd87f.zip
Mass update of all drivers to use the new DMA API. What could possibly go wrong?
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12521 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c')
-rw-r--r--os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
index f121e14bb..c71e38a53 100644
--- a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
+++ b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
@@ -169,8 +169,8 @@ void wspi_lld_init(void) {
#if STM32_WSPI_USE_OCTOSPI1
wspiObjectInit(&WSPID1);
WSPID1.ospi = OCTOSPI1;
- WSPID1.dma = STM32_DMA_STREAM(STM32_WSPI_OCTOSPI1_DMA_CHANNEL);
- WSPID1.dmamode = STM32_DMA_CR_CHSEL(OCTOSPI1_DMA_CHANNEL) |
+ WSPID1.dma = NULL;
+ WSPID1.dmamode = STM32_DMA_CR_CHSEL(OCTOSPI1_DMA_STREAM) |
STM32_DMA_CR_PL(STM32_WSPI_OCTOSPI1_DMA_PRIORITY) |
STM32_DMA_CR_PSIZE_BYTE |
STM32_DMA_CR_MSIZE_BYTE |
@@ -183,8 +183,8 @@ void wspi_lld_init(void) {
#if STM32_WSPI_USE_OCTOSPI2
wspiObjectInit(&WSPID2);
WSPID2.ospi = OCTOSPI2;
- WSPID2.dma = STM32_DMA_STREAM(STM32_WSPI_OCTOSPI2_DMA_CHANNEL);
- WSPID2.dmamode = STM32_DMA_CR_CHSEL(OCTOSPI2_DMA_CHANNEL) |
+ WSPID2.dma = NULL;
+ WSPID2.dmamode = STM32_DMA_CR_CHSEL(OCTOSPI2_DMA_STREAM) |
STM32_DMA_CR_PL(STM32_WSPI_OCTOSPI2_DMA_PRIORITY) |
STM32_DMA_CR_PSIZE_BYTE |
STM32_DMA_CR_MSIZE_BYTE |
@@ -208,11 +208,11 @@ void wspi_lld_start(WSPIDriver *wspip) {
if (wspip->state == WSPI_STOP) {
#if STM32_WSPI_USE_OCTOSPI1
if (&WSPID1 == wspip) {
- bool b = dmaStreamAllocate(wspip->dma,
- STM32_WSPI_OCTOSPI1_DMA_IRQ_PRIORITY,
- (stm32_dmaisr_t)wspi_lld_serve_dma_interrupt,
- (void *)wspip);
- osalDbgAssert(!b, "stream already allocated");
+ wspip->dma = dmaStreamAllocI(STM32_WSPI_OCTOSPI1_DMA_STREAM,
+ STM32_WSPI_OCTOSPI1_DMA_IRQ_PRIORITY,
+ (stm32_dmaisr_t)wspi_lld_serve_dma_interrupt,
+ (void *)wspip);
+ osalDbgAssert(wspip->dma != NULL, "unable to allocate stream");
rccEnableOCTOSPI1(true);
dmaSetRequestSource(wspip->dma, STM32_DMAMUX1_OCTOSPI1);
}
@@ -220,11 +220,11 @@ void wspi_lld_start(WSPIDriver *wspip) {
#if STM32_WSPI_USE_OCTOSPI2
if (&WSPID2 == wspip) {
- bool b = dmaStreamAllocate(wspip->dma,
- STM32_WSPI_OCTOSPI2_DMA_IRQ_PRIORITY,
- (stm32_dmaisr_t)wspi_lld_serve_dma_interrupt,
- (void *)wspip);
- osalDbgAssert(!b, "stream already allocated");
+ wspip->dma = dmaStreamAllocI(STM32_WSPI_OCTOSPI2_DMA_STREAM,
+ STM32_WSPI_OCTOSPI2_DMA_IRQ_PRIORITY,
+ (stm32_dmaisr_t)wspi_lld_serve_dma_interrupt,
+ (void *)wspip);
+ osalDbgAssert(wspip->dma != NULL, "unable to allocate stream");
rccEnableOCTOSPI2(true);
dmaSetRequestSource(wspip->dma, STM32_DMAMUX1_OCTOSPI2);
}
@@ -263,7 +263,8 @@ void wspi_lld_stop(WSPIDriver *wspip) {
wspip->ospi->CR = 0U;
/* Releasing the DMA.*/
- dmaStreamRelease(wspip->dma);
+ dmaStreamFreeI(wspip->dma);
+ wspip->dma = NULL;
/* Stopping involved clocks.*/
#if STM32_WSPI_USE_OCTOSPI1