diff options
author | Uladzimir Pylinski <barthess@yandex.ru> | 2016-07-19 18:56:03 +0000 |
---|---|---|
committer | Uladzimir Pylinski <barthess@yandex.ru> | 2016-07-19 18:56:03 +0000 |
commit | 0edf3f363b0e8222477f1bf956a421ab6e7d2cd5 (patch) | |
tree | 9f53cb6ac75e50776abe22373a41d820ca4255f2 /os/hal/include/hal_uart.h | |
parent | 57dc4418deee2b123301d36eec3a020acee3814b (diff) | |
download | ChibiOS-0edf3f363b0e8222477f1bf956a421ab6e7d2cd5.tar.gz ChibiOS-0edf3f363b0e8222477f1bf956a421ab6e7d2cd5.tar.bz2 ChibiOS-0edf3f363b0e8222477f1bf956a421ab6e7d2cd5.zip |
[STM32. USARTv2] Added receiver timeout handling.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9713 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/hal_uart.h')
-rw-r--r-- | os/hal/include/hal_uart.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/os/hal/include/hal_uart.h b/os/hal/include/hal_uart.h index 02537aa29..01a505c9a 100644 --- a/os/hal/include/hal_uart.h +++ b/os/hal/include/hal_uart.h @@ -279,7 +279,6 @@ typedef enum { _uart_wakeup_rx_error_isr(uartp); \
}
-
/**
* @brief Common ISR code for RX on idle.
* @details This code handles the portable part of the ISR code:
@@ -298,6 +297,27 @@ typedef enum { if ((uartp)->config->rxchar_cb != NULL) \
(uartp)->config->rxchar_cb(uartp, (uartp)->rxbuf); \
}
+
+
+/**
+ * @brief Timeout ISR code for receiver.
+ * @details This code handles the portable part of the ISR code:
+ * - Callback invocation.
+ * - Waiting thread wakeup, if any.
+ * - Driver state transitions.
+ * .
+ * @note This macro is meant to be used in the low level drivers
+ * implementation only.
+ *
+ * @param[in] uartp pointer to the @p UARTDriver object
+ *
+ * @notapi
+ */
+#define _uart_timeout_isr_code(uartp) { \
+ if ((uartp)->config->timeout_cb != NULL) \
+ (uartp)->config->timeout_cb(uartp); \
+}
+
/** @} */
/*===========================================================================*/
|