From cecf2033885448f63a6d27cc96be3127eab0eee4 Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Wed, 18 Mar 2020 01:06:30 +0800 Subject: [PATCH] [nrf528xx] add volatile mark to nrf uart read/write buffers (#4652) These buffers are touched in volatile and should be marked as volatile. --- examples/platforms/nrf528xx/src/transport/uart.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/platforms/nrf528xx/src/transport/uart.c b/examples/platforms/nrf528xx/src/transport/uart.c index 2a24bc118..640ab86d4 100644 --- a/examples/platforms/nrf528xx/src/transport/uart.c +++ b/examples/platforms/nrf528xx/src/transport/uart.c @@ -56,16 +56,16 @@ bool sUartEnabled = false; /** * UART TX buffer variables. */ -static const uint8_t *sTransmitBuffer = NULL; -static uint16_t sTransmitLength = 0; -static bool sTransmitDone = 0; +static volatile const uint8_t *sTransmitBuffer = NULL; +static volatile uint16_t sTransmitLength = 0; +static volatile bool sTransmitDone = 0; /** * UART RX ring buffer variables. */ -static uint8_t sReceiveBuffer[UART_RX_BUFFER_SIZE]; -static uint16_t sReceiveHead = 0; -static uint16_t sReceiveTail = 0; +static uint8_t sReceiveBuffer[UART_RX_BUFFER_SIZE]; +static volatile uint16_t sReceiveHead = 0; +static volatile uint16_t sReceiveTail = 0; /** * Function for checking if RX buffer is full.