Skip to content

Commit 586319c

Browse files
authored
chrore(usb): external redefinition of CDC_*_QUEUE_BUFFER_PACKET_NUMBER (#2165)
* admit external definition of CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER
1 parent 42b2ab2 commit 586319c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cores/arduino/stm32/usb/cdc/cdc_queue.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,14 @@ extern "C" {
5353
#else
5454
#define CDC_QUEUE_MAX_PACKET_SIZE USB_FS_MAX_PACKET_SIZE
5555
#endif
56-
#define CDC_TRANSMIT_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * 2))
57-
#define CDC_RECEIVE_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * 3))
56+
#ifndef CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER
57+
#define CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER 2
58+
#endif
59+
#ifndef CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER
60+
#define CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER 3
61+
#endif
62+
#define CDC_TRANSMIT_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER))
63+
#define CDC_RECEIVE_QUEUE_BUFFER_SIZE ((uint16_t)(CDC_QUEUE_MAX_PACKET_SIZE * CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER))
5864

5965
typedef struct {
6066
uint8_t buffer[CDC_TRANSMIT_QUEUE_BUFFER_SIZE];
@@ -91,4 +97,4 @@ void CDC_ReceiveQueue_CommitBlock(CDC_ReceiveQueue_TypeDef *queue, uint16_t size
9197
}
9298
#endif
9399

94-
#endif // __CDC_QUEUE_H
100+
#endif // __CDC_QUEUE_H

0 commit comments

Comments
 (0)