From 218b5100dd9e4b9bb3b0aa7fc77467373e932025 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 */