From ba16b5d3162af0824ce78f1cee6de3db2ac34985 Mon Sep 17 00:00:00 2001
From: Paolo Patruno
Date: Fri, 3 Nov 2023 09:59:10 +0100
Subject: [PATCH 1/2] admit external definition of
CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER
CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER
---
cores/arduino/stm32/usb/cdc/cdc_queue.h | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/cores/arduino/stm32/usb/cdc/cdc_queue.h b/cores/arduino/stm32/usb/cdc/cdc_queue.h
index cd10ac2bc5..6b682476d2 100644
--- a/cores/arduino/stm32/usb/cdc/cdc_queue.h
+++ b/cores/arduino/stm32/usb/cdc/cdc_queue.h
@@ -53,8 +53,14 @@ extern "C" {
#else
#define CDC_QUEUE_MAX_PACKET_SIZE USB_FS_MAX_PACKET_SIZE
#endif
-#define CDC_TRANSMIT_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * 2))
-#define CDC_RECEIVE_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * 3))
+#ifndef(CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER)
+#define CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER 2
+#endif
+#ifndef(CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER)
+#define CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER 3
+#endif
+#define CDC_TRANSMIT_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER))
+#define CDC_RECEIVE_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER))
typedef struct {
uint8_t buffer[CDC_TRANSMIT_QUEUE_BUFFER_SIZE];
@@ -91,4 +97,4 @@ void CDC_ReceiveQueue_CommitBlock(CDC_ReceiveQueue_TypeDef *queue, uint16_t size
}
#endif
-#endif // __CDC_QUEUE_H
\ No newline at end of file
+#endif // __CDC_QUEUE_H
From 5033fd31c2bede152dd9e231cc6639a43f41c6c5 Mon Sep 17 00:00:00 2001
From: Paolo Patruno
Date: Fri, 3 Nov 2023 18:05:30 +0100
Subject: [PATCH 2/2] sintax error
---
cores/arduino/stm32/usb/cdc/cdc_queue.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cores/arduino/stm32/usb/cdc/cdc_queue.h b/cores/arduino/stm32/usb/cdc/cdc_queue.h
index 6b682476d2..1ec58d02f0 100644
--- a/cores/arduino/stm32/usb/cdc/cdc_queue.h
+++ b/cores/arduino/stm32/usb/cdc/cdc_queue.h
@@ -53,10 +53,10 @@ extern "C" {
#else
#define CDC_QUEUE_MAX_PACKET_SIZE USB_FS_MAX_PACKET_SIZE
#endif
-#ifndef(CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER)
+#ifndef CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER
#define CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER 2
#endif
-#ifndef(CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER)
+#ifndef CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER
#define CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER 3
#endif
#define CDC_TRANSMIT_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER))