aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/uart.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-01-19 08:01:56 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-01-19 08:01:56 +0000
commit844c70e2e51206ffd54e563cb69eb60c9cccad1f (patch)
treef9ba90b1b15cde7b35fe3fd5b683dfd0a5f217db /os/hal/src/uart.c
parent78116c85648a2b13c582f0857d7bcdf062251825 (diff)
downloadChibiOS-844c70e2e51206ffd54e563cb69eb60c9cccad1f.tar.gz
ChibiOS-844c70e2e51206ffd54e563cb69eb60c9cccad1f.tar.bz2
ChibiOS-844c70e2e51206ffd54e563cb69eb60c9cccad1f.zip
Fixed bug 3600789.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5080 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/uart.c')
-rw-r--r--os/hal/src/uart.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/os/hal/src/uart.c b/os/hal/src/uart.c
index 1ab95a8ee..8462aafb1 100644
--- a/os/hal/src/uart.c
+++ b/os/hal/src/uart.c
@@ -143,8 +143,10 @@ void uartStartSend(UARTDriver *uartp, size_t n, const void *txbuf) {
"uartStartSend");
chSysLock();
- chDbgAssert((uartp->state == UART_READY) && (uartp->txstate == UART_TX_IDLE),
- "uartStartSend(), #1", "not active");
+ chDbgAssert(uartp->state == UART_READY,
+ "uartStartSend(), #1", "is active");
+ chDbgAssert(uartp->txstate != UART_TX_ACTIVE,
+ "uartStartSend(), #2", "tx active");
uart_lld_start_send(uartp, n, txbuf);
uartp->txstate = UART_TX_ACTIVE;
@@ -168,9 +170,10 @@ void uartStartSendI(UARTDriver *uartp, size_t n, const void *txbuf) {
chDbgCheckClassI();
chDbgCheck((uartp != NULL) && (n > 0) && (txbuf != NULL),
"uartStartSendI");
- chDbgAssert((uartp->state == UART_READY) &&
- (uartp->txstate != UART_TX_ACTIVE),
- "uartStartSendI(), #1", "not active");
+ chDbgAssert(uartp->state == UART_READY,
+ "uartStartSendI(), #1", "is active");
+ chDbgAssert(uartp->txstate != UART_TX_ACTIVE,
+ "uartStartSendI(), #2", "tx active");
uart_lld_start_send(uartp, n, txbuf);
uartp->txstate = UART_TX_ACTIVE;
@@ -250,8 +253,10 @@ void uartStartReceive(UARTDriver *uartp, size_t n, void *rxbuf) {
"uartStartReceive");
chSysLock();
- chDbgAssert((uartp->state == UART_READY) && (uartp->rxstate == UART_RX_IDLE),
- "uartStartReceive(), #1", "not active");
+ chDbgAssert(uartp->state == UART_READY,
+ "uartStartReceive(), #1", "is active");
+ chDbgAssert(uartp->rxstate != UART_RX_ACTIVE,
+ "uartStartReceive(), #2", "rx active");
uart_lld_start_receive(uartp, n, rxbuf);
uartp->rxstate = UART_RX_ACTIVE;
@@ -275,8 +280,10 @@ void uartStartReceiveI(UARTDriver *uartp, size_t n, void *rxbuf) {
chDbgCheckClassI();
chDbgCheck((uartp != NULL) && (n > 0) && (rxbuf != NULL),
"uartStartReceiveI");
- chDbgAssert((uartp->state == UART_READY) && (uartp->rxstate == UART_RX_IDLE),
- "uartStartReceiveI(), #1", "not active");
+ chDbgAssert(uartp->state == UART_READY,
+ "uartStartReceiveI(), #1", "is active");
+ chDbgAssert(uartp->rxstate != UART_RX_ACTIVE,
+ "uartStartReceiveI(), #2", "rx active");
uart_lld_start_receive(uartp, n, rxbuf);
uartp->rxstate = UART_RX_ACTIVE;