git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12040 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
Giovanni Di Sirio 2018-05-17 10:51:04 +00:00
parent 9c5361af2a
commit e9399566d7
3 changed files with 17 additions and 8 deletions

View File

@ -43,6 +43,13 @@
#define UART_BREAK_DETECTED 64 /**< @brief Break detected. */
/** @} */
/**
* @name UART error conditions
* @{
*/
#define UART_ERR_NOT_ACTIVE (size_t)-1
/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/

View File

@ -188,7 +188,7 @@ void uartStartSendI(UARTDriver *uartp, size_t n, const void *txbuf) {
*
* @return The number of data frames not transmitted by the
* stopped transmit operation.
* @retval 0 There was no transmit operation in progress.
* @retval UART_ERR_NOT_ACTIVE if there was no transmit operation in progress.
*
* @api
*/
@ -205,7 +205,7 @@ size_t uartStopSend(UARTDriver *uartp) {
uartp->txstate = UART_TX_IDLE;
}
else {
n = 0;
n = UART_ERR_NOT_ACTIVE;
}
osalSysUnlock();
@ -221,7 +221,7 @@ size_t uartStopSend(UARTDriver *uartp) {
*
* @return The number of data frames not transmitted by the
* stopped transmit operation.
* @retval 0 There was no transmit operation in progress.
* @retval UART_ERR_NOT_ACTIVE if there was no transmit operation in progress.
*
* @iclass
*/
@ -236,7 +236,7 @@ size_t uartStopSendI(UARTDriver *uartp) {
uartp->txstate = UART_TX_IDLE;
return n;
}
return 0;
return UART_ERR_NOT_ACTIVE;
}
/**
@ -294,7 +294,7 @@ void uartStartReceiveI(UARTDriver *uartp, size_t n, void *rxbuf) {
*
* @return The number of data frames not received by the
* stopped receive operation.
* @retval 0 There was no receive operation in progress.
* @retval UART_ERR_NOT_ACTIVE if there was no receive operation in progress.
*
* @api
*/
@ -311,7 +311,7 @@ size_t uartStopReceive(UARTDriver *uartp) {
uartp->rxstate = UART_RX_IDLE;
}
else {
n = 0;
n = UART_ERR_NOT_ACTIVE;
}
osalSysUnlock();
@ -327,7 +327,7 @@ size_t uartStopReceive(UARTDriver *uartp) {
*
* @return The number of data frames not received by the
* stopped receive operation.
* @retval 0 There was no receive operation in progress.
* @retval UART_ERR_NOT_ACTIVE if there was no receive operation in progress.
*
* @iclass
*/
@ -342,7 +342,7 @@ size_t uartStopReceiveI(UARTDriver *uartp) {
uartp->rxstate = UART_RX_IDLE;
return n;
}
return 0;
return UART_ERR_NOT_ACTIVE;
}
#if (UART_USE_WAIT == TRUE) || defined(__DOXYGEN__)

View File

@ -126,6 +126,8 @@
- EX: Updated LIS302DL to 1.1.0 (backported to 18.2.1).
- EX: Updated LPS25H to 1.1.0 (backported to 18.2.1).
- EX: Updated LSM303DLHC to 1.1.0 (backported to 18.2.1).
- HAL: Fixed missing definition in UART driver (bug #948)(backported
to 18.2.2).
- OTH: Fixed wrong macro check in GCC Cortex-M startup files (bug #947)
(backported to 18.2.2 and 17.6.5).
- HAL: Fixed binary instead of logic operator in STM32F4 HAL (bug #946)