mbed
Fork of mbed-dev by
Diff: targets/TARGET_STM/TARGET_STM32F2/serial_device.c
- Revision:
- 178:d650f5d4c87a
- Parent:
- 171:19eb464bc2be
- Child:
- 181:96ed750bd169
diff -r 447f873cad2f -r d650f5d4c87a targets/TARGET_STM/TARGET_STM32F2/serial_device.c --- a/targets/TARGET_STM/TARGET_STM32F2/serial_device.c Wed Oct 25 14:53:38 2017 +0100 +++ b/targets/TARGET_STM/TARGET_STM32F2/serial_device.c Wed Nov 08 13:50:44 2017 +0000 @@ -259,7 +259,7 @@ } if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) != RESET) { if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) { - volatile uint32_t tmpval = huart->Instance->DR; // Clear ORE flag + volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear ORE flag } } } @@ -720,13 +720,13 @@ void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) { if (__HAL_UART_GET_FLAG(huart, UART_FLAG_PE) != RESET) { - volatile uint32_t tmpval = huart->Instance->DR; // Clear PE flag + volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear PE flag } else if (__HAL_UART_GET_FLAG(huart, UART_FLAG_FE) != RESET) { - volatile uint32_t tmpval = huart->Instance->DR; // Clear FE flag + volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear FE flag } else if (__HAL_UART_GET_FLAG(huart, UART_FLAG_NE) != RESET) { - volatile uint32_t tmpval = huart->Instance->DR; // Clear NE flag + volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear NE flag } else if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) != RESET) { - volatile uint32_t tmpval = huart->Instance->DR; // Clear ORE flag + volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear ORE flag } } @@ -777,9 +777,9 @@ HAL_UART_IRQHandler(huart); // Abort if an error occurs - if (return_event & SERIAL_EVENT_RX_PARITY_ERROR || - return_event & SERIAL_EVENT_RX_FRAMING_ERROR || - return_event & SERIAL_EVENT_RX_OVERRUN_ERROR) { + if ((return_event & SERIAL_EVENT_RX_PARITY_ERROR) || + (return_event & SERIAL_EVENT_RX_FRAMING_ERROR) || + (return_event & SERIAL_EVENT_RX_OVERRUN_ERROR)) { return return_event; } @@ -853,7 +853,7 @@ // clear flags __HAL_UART_CLEAR_FLAG(huart, UART_FLAG_RXNE); - volatile uint32_t tmpval = huart->Instance->DR; // Clear error flags + volatile uint32_t tmpval __attribute__((unused)) = huart->Instance->DR; // Clear error flags // reset states huart->RxXferCount = 0;