aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-11-01 10:56:12 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-11-01 10:56:12 +0000
commitca59ce3238108443bf04729f717f9c37d3472937 (patch)
treece0ed5bac16f8ffa0164958f4067396c2c2e84cd /os/hal/src
parent61509a21dee90992110a310734db5744a1c01b45 (diff)
downloadChibiOS-ca59ce3238108443bf04729f717f9c37d3472937.tar.gz
ChibiOS-ca59ce3238108443bf04729f717f9c37d3472937.tar.bz2
ChibiOS-ca59ce3238108443bf04729f717f9c37d3472937.zip
Fixed bug #659.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8415 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/serial.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/os/hal/src/serial.c b/os/hal/src/serial.c
index 4b3111412..609e5a348 100644
--- a/os/hal/src/serial.c
+++ b/os/hal/src/serial.c
@@ -234,6 +234,55 @@ msg_t sdRequestDataI(SerialDriver *sdp) {
return b;
}
+/**
+ * @brief Direct output check on a @p SerialDriver.
+ * @note This function bypasses the indirect access to the channel and
+ * checks directly the output queue. This is faster but cannot
+ * be used to check different channels implementations.
+ *
+ * @param[in] sdp pointer to a @p SerialDriver structure
+ * @return The queue status.
+ * @retval false if the next write operation would not block.
+ * @retval true if the next write operation would block.
+ *
+ * @deprecated
+ *
+ * @api
+ */
+bool sdPutWouldBlock(SerialDriver *sdp) {
+ bool b;
+
+ osalSysLock();
+ b = oqIsFullI(&sdp->oqueue);
+ osalSysUnlock();
+
+ return b;
+}
+
+/**
+ * @brief Direct input check on a @p SerialDriver.
+ * @note This function bypasses the indirect access to the channel and
+ * checks directly the input queue. This is faster but cannot
+ * be used to check different channels implementations.
+ *
+ * @return The queue status.
+ * @retval false if the next write operation would not block.
+ * @retval true if the next write operation would block.
+ *
+ * @deprecated
+ *
+ * @api
+ */
+bool sdGetWouldBlock(SerialDriver *sdp) {
+ bool b;
+
+ osalSysLock();
+ b = iqIsEmptyI(&sdp->iqueue);
+ osalSysUnlock();
+
+ return b;
+}
+
#endif /* HAL_USE_SERIAL == TRUE */
/** @} */