Skip to content

Commit

Permalink
chrore(usb): external redefinition of CDC_*_QUEUE_BUFFER_PACKET_NUMBER (
Browse files Browse the repository at this point in the history
#2165)

* admit external definition of CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER
  • Loading branch information
pat1 authored Nov 6, 2023
1 parent 42b2ab2 commit 586319c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cores/arduino/stm32/usb/cdc/cdc_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -91,4 +97,4 @@ void CDC_ReceiveQueue_CommitBlock(CDC_ReceiveQueue_TypeDef *queue, uint16_t size
}
#endif

#endif // __CDC_QUEUE_H
#endif // __CDC_QUEUE_H

0 comments on commit 586319c

Please sign in to comment.