diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-22 16:12:32 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-22 16:12:32 +0000 |
commit | a3528b0e3edfb0667c39d61b21396fc852bd9fcd (patch) | |
tree | 2f0993f54b5403f5955004ab0bcdcae9abd9ab5b /os/hal/include | |
parent | 2f7be482b19d34ec9bc86ce31d589430e2737e29 (diff) | |
download | ChibiOS-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')
-rw-r--r-- | os/hal/include/hal_buffers.h | 10 | ||||
-rw-r--r-- | os/hal/include/serial_usb.h | 1 |
2 files changed, 10 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
diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index fca8d56ea..0ca4ba06d 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -260,6 +260,7 @@ extern "C" { void sduDisconnectI(SerialUSBDriver *sdup);
void sduConfigureHookI(SerialUSBDriver *sdup);
bool sduRequestsHook(USBDriver *usbp);
+ void sduSOFHookI(SerialUSBDriver *sdup);
void sduDataTransmitted(USBDriver *usbp, usbep_t ep);
void sduDataReceived(USBDriver *usbp, usbep_t ep);
void sduInterruptTransmitted(USBDriver *usbp, usbep_t ep);
|