From 2f7be482b19d34ec9bc86ce31d589430e2737e29 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 21 Dec 2015 16:49:54 +0000 Subject: Changes to Serial_USB, unfinished. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8630 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/serial_usb.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'os/hal/include/serial_usb.h') diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h index 22e873ea1..fca8d56ea 100644 --- a/os/hal/include/serial_usb.h +++ b/os/hal/include/serial_usb.h @@ -121,6 +121,14 @@ #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) #define SERIAL_USB_BUFFERS_SIZE 256 #endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif /** @} */ /*===========================================================================*/ @@ -192,14 +200,16 @@ typedef struct { _base_asynchronous_channel_data \ /* Driver state.*/ \ sdustate_t state; \ - /* Input queue.*/ \ - input_queue_t iqueue; \ + /* Input buffers queue.*/ \ + input_buffers_queue_t ibqueue; \ /* Output queue.*/ \ - output_queue_t oqueue; \ + output_buffers_queue_t obqueue; \ /* Input buffer.*/ \ - uint8_t ib[SERIAL_USB_BUFFERS_SIZE]; \ + uint8_t ib[BQ_BUFFER_SIZE(SERIAL_USB_BUFFERS_NUMBER, \ + SERIAL_USB_BUFFERS_SIZE)]; \ /* Output buffer.*/ \ - uint8_t ob[SERIAL_USB_BUFFERS_SIZE]; \ + uint8_t ob[BQ_BUFFER_SIZE(SERIAL_USB_BUFFERS_NUMBER, \ + SERIAL_USB_BUFFERS_SIZE)]; \ /* End of the mandatory fields.*/ \ /* Current configuration data.*/ \ const SerialUSBConfig *config; -- cgit v1.2.3