aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/uart.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-21 13:19:48 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-21 13:19:48 +0000
commitf23670b728189b4549091d355e38218b31c0a0ad (patch)
tree33d4199ca6898675b6b108ab881b148c5924fd65 /os/hal/src/uart.c
parent4e35a12a2a84afa813bf619df3bbb8146b98a973 (diff)
downloadChibiOS-f23670b728189b4549091d355e38218b31c0a0ad.tar.gz
ChibiOS-f23670b728189b4549091d355e38218b31c0a0ad.tar.bz2
ChibiOS-f23670b728189b4549091d355e38218b31c0a0ad.zip
Added I-class function checks to HAL APIs.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3244 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/uart.c')
-rw-r--r--os/hal/src/uart.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/os/hal/src/uart.c b/os/hal/src/uart.c
index 05fdbb168..372a3ad02 100644
--- a/os/hal/src/uart.c
+++ b/os/hal/src/uart.c
@@ -161,12 +161,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 +217,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 +268,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 +323,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");