From 81784fa9266005e4aec5ebab1cc6f10e74b308ca Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 25 Apr 2024 21:15:46 +0930 Subject: [PATCH] Mark new_data_is_received as volatile --- bootloader/F4/Src/main.c | 2 +- bootloader/F4/Src/usbd_custom_hid_if.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootloader/F4/Src/main.c b/bootloader/F4/Src/main.c index abda4430..df436d38 100644 --- a/bootloader/F4/Src/main.c +++ b/bootloader/F4/Src/main.c @@ -79,7 +79,7 @@ static uint8_t CMD_SIGNATURE[7] = {'B','T','L','D','C','M','D'}; /* Command: */ static uint8_t CMD_DATA_RECEIVED[8] = {'B','T','L','D','C','M','D',2}; -uint8_t new_data_is_received = 0; +volatile uint8_t new_data_is_received = 0; static uint8_t pageData[SECTOR_SIZE]; typedef void (*funct_ptr)(void); diff --git a/bootloader/F4/Src/usbd_custom_hid_if.c b/bootloader/F4/Src/usbd_custom_hid_if.c index e18a0d42..ceca737a 100644 --- a/bootloader/F4/Src/usbd_custom_hid_if.c +++ b/bootloader/F4/Src/usbd_custom_hid_if.c @@ -61,7 +61,7 @@ /* USER CODE BEGIN PV */ /* Private variables ---------------------------------------------------------*/ extern uint8_t USB_RX_Buffer[CUSTOM_HID_EPOUT_SIZE]; -extern uint8_t new_data_is_received; +extern volatile uint8_t new_data_is_received; /* USER CODE END PV */ /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY