aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/serial_usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/include/serial_usb.h')
-rw-r--r--os/hal/include/serial_usb.h20
1 files changed, 15 insertions, 5 deletions
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;