mbed library sources
Dependents: Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more
Superseded
This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.
Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.
If you are looking for a stable and tested release, please import one of the official mbed library releases:
Import librarymbed
The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Diff: targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_hal_uart.c
- Revision:
- 610:813dcc80987e
- Parent:
- 573:ad23fe03a082
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_hal_uart.c Fri Aug 14 12:45:09 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_hal_uart.c Fri Aug 14 13:15:17 2015 +0100 @@ -2,10 +2,9 @@ ****************************************************************************** * @file stm32f7xx_hal_uart.c * @author MCD Application Team - * @version V1.0.0 - * @date 12-May-2015 + * @version V1.0.1 + * @date 25-June-2015 * @brief UART HAL module driver. - * * This file provides firmware functions to manage the following * functionalities of the Universal Asynchronous Receiver Transmitter (UART) peripheral: * + Initialization and de-initialization functions @@ -551,7 +550,7 @@ * @verbatim =============================================================================== - ##### I/O operation functions ##### + ##### IO operation functions ##### =============================================================================== This subsection provides a set of functions allowing to manage the UART asynchronous and Half duplex data transfers. @@ -1053,13 +1052,20 @@ } else if(huart->State == HAL_UART_STATE_BUSY_RX) { + /* Clear the Overrun flag before resuming the Rx transfer*/ + __HAL_UART_CLEAR_IT(huart, UART_CLEAR_OREF); + /* Enable the UART DMA Rx request */ huart->Instance->CR3 |= USART_CR3_DMAR; } else if(huart->State == HAL_UART_STATE_BUSY_TX_RX) { + /* Clear the Overrun flag before resuming the Rx transfer*/ + __HAL_UART_CLEAR_IT(huart, UART_CLEAR_OREF); + /* Enable the UART DMA Rx request before the DMA Tx request */ huart->Instance->CR3 |= USART_CR3_DMAR; + /* Enable the UART DMA Tx request */ huart->Instance->CR3 |= USART_CR3_DMAT; } @@ -1071,8 +1077,7 @@ __HAL_UART_ENABLE(huart); } - /* TEACK and/or REACK to check before moving huart->State to Ready */ - return (UART_CheckIdleState(huart)); + return HAL_OK; } /** @@ -1082,8 +1087,12 @@ */ HAL_StatusTypeDef HAL_UART_DMAStop(UART_HandleTypeDef *huart) { - /* Process Locked */ - __HAL_LOCK(huart); + /* The Lock is not implemented on this API to allow the user application + to call the HAL UART API under callbacks HAL_UART_TxCpltCallback() / HAL_UART_RxCpltCallback() / + HAL_UART_TxHalfCpltCallback / HAL_UART_RxHalfCpltCallback: + indeed, when HAL_DMA_Abort() API is called, the DMA TX/RX Transfer or Half Transfer complete + interrupt is generated if the DMA transfer interruption occurs at the middle or at the end of + the stream and the corresponding call back is executed. */ /* Disable the UART Tx/Rx DMA requests */ huart->Instance->CR3 &= ~USART_CR3_DMAT; @@ -1100,14 +1109,8 @@ HAL_DMA_Abort(huart->hdmarx); } - /* Disable UART peripheral */ - __HAL_UART_DISABLE(huart); - huart->State = HAL_UART_STATE_READY; - /* Process Unlocked */ - __HAL_UNLOCK(huart); - return HAL_OK; }