From d65f2107f899b99813f1cda9834112386ab4ef16 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 12 Nov 2018 11:03:43 +0000 Subject: Simplified. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12415 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'os/hal') 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 c7fad45f3..e3cc607a4 100644 --- a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c +++ b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c @@ -418,8 +418,7 @@ void wspi_lld_map_flash(WSPIDriver *wspip, wspi_lld_sync(wspip); /* Starting memory mapped mode using the passed parameters.*/ - wspip->ospi->CR = (wspip->ospi->CR & ~OCTOSPI_CR_FMODE) | - (OCTOSPI_CR_FMODE_1 | OCTOSPI_CR_FMODE_0); + wspip->ospi->CR = OCTOSPI_CR_FMODE_1 | OCTOSPI_CR_FMODE_0 | OCTOSPI_CR_EN; wspip->ospi->TCR = cmdp->dummy; wspip->ospi->CCR = cmdp->cfg; wspip->ospi->IR = cmdp->cmd; @@ -463,8 +462,8 @@ void wspi_lld_unmap_flash(WSPIDriver *wspip) { while ((wspip->ospi->CR & OCTOSPI_CR_ABORT) != 0U) { } - /* Re-enabling DMA request, we are going back to indirect mode.*/ - wspip->ospi->CR |= OCTOSPI_CR_DMAEN; + /* Disabling memory mapped mode and re-enabling DMA and IRQs.*/ + wspip->ospi->CR = OCTOSPI_CR_TCIE | OCTOSPI_CR_DMAEN | OCTOSPI_CR_EN; } #endif /* WSPI_SUPPORTS_MEMMAP == TRUE */ -- cgit v1.2.3