From a3528b0e3edfb0667c39d61b21396fc852bd9fcd Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 22 Dec 2015 16:12:32 +0000 Subject: 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 --- os/hal/include/hal_buffers.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'os/hal/include/hal_buffers.h') 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 @@ -101,6 +101,12 @@ struct io_buffers_queue { * @brief Boundary for R/W sequential access. */ 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. */ @@ -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 -- cgit v1.2.3