diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-28 13:39:56 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-28 13:39:56 +0000 |
commit | fc492c6d190610cc9537360edf44d6dc5d072a2c (patch) | |
tree | 53fb1786e058f872671fb3adca4e73c708716d54 /os/hal/src/uart.c | |
parent | da23780899ae4b9ce1bbe0cb9109da1c87fe0fa1 (diff) | |
parent | 663214d0e6728d153fd4118324e69c75c574327c (diff) | |
download | ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.tar.gz ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.tar.bz2 ChibiOS-fc492c6d190610cc9537360edf44d6dc5d072a2c.zip |
I2C. Merge code from trunk.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3263 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/uart.c')
-rw-r--r-- | os/hal/src/uart.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/os/hal/src/uart.c b/os/hal/src/uart.c index 05fdbb168..ed28ecb3b 100644 --- a/os/hal/src/uart.c +++ b/os/hal/src/uart.c @@ -32,6 +32,10 @@ #if HAL_USE_UART || defined(__DOXYGEN__)
/*===========================================================================*/
+/* Driver local definitions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
@@ -161,12 +165,13 @@ void uartStartSend(UARTDriver *uartp, size_t n, const void *txbuf) { */
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");
+
uart_lld_start_send(uartp, n, txbuf);
uartp->txstate = UART_TX_ACTIVE;
}
@@ -216,8 +221,8 @@ size_t uartStopSend(UARTDriver *uartp) { */
size_t uartStopSendI(UARTDriver *uartp) {
+ chDbgCheckClassI();
chDbgCheck(uartp != NULL, "uartStopSendI");
-
chDbgAssert(uartp->state == UART_READY, "uartStopSendI(), #1", "not active");
if (uartp->txstate == UART_TX_ACTIVE) {
@@ -267,9 +272,9 @@ void uartStartReceive(UARTDriver *uartp, size_t n, void *rxbuf) { */
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");
@@ -322,8 +327,9 @@ size_t uartStopReceive(UARTDriver *uartp) { * @iclass
*/
size_t uartStopReceiveI(UARTDriver *uartp) {
- chDbgCheck(uartp != NULL, "uartStopReceiveI");
+ chDbgCheckClassI();
+ chDbgCheck(uartp != NULL, "uartStopReceiveI");
chDbgAssert(uartp->state == UART_READY,
"uartStopReceiveI(), #1", "not active");
|