From 4ba3ef94f1d79bd33541f177fd548d4a605dc67a Mon Sep 17 00:00:00 2001 From: deividAlfa <48562135+deividAlfa@users.noreply.github.com> Date: Sat, 18 Sep 2021 22:00:05 +0200 Subject: [PATCH] Declare DMA Handler State as volatile Not doing so causes issues when optimizations are enabled, the flag can change at any time by the DMA interrupt, but the compiler is unaware. --- Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h b/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h index 9a407f4..39ca574 100644 --- a/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h +++ b/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h @@ -116,7 +116,7 @@ typedef struct __DMA_HandleTypeDef HAL_LockTypeDef Lock; /*!< DMA locking object */ - HAL_DMA_StateTypeDef State; /*!< DMA transfer state */ + __IO HAL_DMA_StateTypeDef State; /*!< DMA transfer state */ void *Parent; /*!< Parent object state */