aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/hal_buffers.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-12-22 16:12:32 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-12-22 16:12:32 +0000
commita3528b0e3edfb0667c39d61b21396fc852bd9fcd (patch)
tree2f0993f54b5403f5955004ab0bcdcae9abd9ab5b /os/hal/include/hal_buffers.h
parent2f7be482b19d34ec9bc86ce31d589430e2737e29 (diff)
downloadChibiOS-a3528b0e3edfb0667c39d61b21396fc852bd9fcd.tar.gz
ChibiOS-a3528b0e3edfb0667c39d61b21396fc852bd9fcd.tar.bz2
ChibiOS-a3528b0e3edfb0667c39d61b21396fc852bd9fcd.zip
Updated Serial-USB driver using the new buffering mechanism. Only the STM32F4 CDC demo updated for it. Apparently it works.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8631 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/hal_buffers.h')
-rw-r--r--os/hal/include/hal_buffers.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/os/hal/include/hal_buffers.h b/os/hal/include/hal_buffers.h
index e5d5fa7b9..d537477f2 100644
--- a/os/hal/include/hal_buffers.h
+++ b/os/hal/include/hal_buffers.h
@@ -102,6 +102,12 @@ struct io_buffers_queue {
*/
uint8_t *top;
/**
+ * @brief Buffer is being accessed.
+ * @details This flag indicates that the current buffer is being read or
+ * written by a long, preemptable operation.
+ */
+ bool accessed;
+ /**
* @brief Data notification callback.
*/
bqnotify_t notify;
@@ -205,7 +211,7 @@ typedef io_buffers_queue_t output_buffers_queue_t;
*
* @iclass
*/
-#define obqIsEmptyI(oqp) ((bool)(((obqp)->bwrptr == (obqp)->brdptr) && \
+#define obqIsEmptyI(oqp) ((bool)(((obqp)->bwrptr == (obqp)->brdptr) && \
((obqp)->bcounter != 0U)))
/**
@@ -254,6 +260,8 @@ extern "C" {
systime_t timeout);
size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp,
size_t n, systime_t timeout);
+ bool obqTryFlushI(output_buffers_queue_t *obqp);
+ void obqFlush(output_buffers_queue_t *obqp);
#ifdef __cplusplus
}
#endif