From 0a6ffce446146d57d98f36baab7cc7ab4e96030d Mon Sep 17 00:00:00 2001 From: wdfk-prog <1425075683@qq.com> Date: Fri, 16 Dec 2022 15:10:42 +0800 Subject: [PATCH] =?UTF-8?q?[STM32][SPI]=E4=BD=BF=E7=94=A8rt=5Fhw=5Fcpu=5Fd?= =?UTF-8?q?cache=5Fops=E5=87=BD=E6=95=B0=E6=9B=BF=E6=8D=A2HAL=E5=BA=93?= =?UTF-8?q?=E5=87=BD=E6=95=B0=20(#6745)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [STM32][SPI]使用rt_hw_cpu_dcache_ops函数替换HAL库函数 * 规范代码格式 --- bsp/stm32/libraries/HAL_Drivers/drv_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_spi.c b/bsp/stm32/libraries/HAL_Drivers/drv_spi.c index c0f707a13e..3dd0728b37 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_spi.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_spi.c @@ -347,7 +347,7 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message * { rt_memset(dma_buf, 0xFF, send_length); } - SCB_CleanDCache_by_Addr(dma_buf, send_length); + rt_hw_cpu_dcache_ops(RT_HW_CACHE_FLUSH, dma_buf, send_length); state = HAL_SPI_TransmitReceive_DMA(spi_handle, (uint8_t *)dma_buf, (uint8_t *)dma_buf, send_length); } else @@ -424,7 +424,7 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message * { if(recv_buf) { - SCB_InvalidateDCache_by_Addr(dma_buf, send_length); + rt_hw_cpu_dcache_ops(RT_HW_CACHE_INVALIDATE, dma_buf, send_length); rt_memcpy(recv_buf, dma_buf,send_length); } rt_free_align(dma_buf);