|
25 | 25 | #include <stdint.h> |
26 | 26 | #include "usbd_def.h" |
27 | 27 |
|
| 28 | +#if defined (USE_HAL_PCD_USB_DOUBLE_BUFFER) && (USE_HAL_PCD_USB_DOUBLE_BUFFER == 0) |
| 29 | + #define USBD_CDC_USE_SINGLE_BUFFER |
| 30 | +#endif |
| 31 | + |
28 | 32 | typedef struct { |
29 | 33 | uint32_t ep_adress; /* Endpoint address */ |
30 | 34 | uint32_t ep_size; /* Endpoint size */ |
@@ -69,21 +73,15 @@ typedef struct { |
69 | 73 |
|
70 | 74 | #ifdef USBD_USE_CDC |
71 | 75 | #define PMA_CDC_OUT_BASE (PMA_EP0_IN_ADDR + USB_MAX_EP0_SIZE) |
72 | | -#if defined(STM32C5xx) |
73 | | -/* |
74 | | - * The C5 USB DRD FS peripheral is used with bulk double buffering disabled. |
75 | | - * Keep each CDC endpoint in its own 64-byte PMA area; in particular, the |
76 | | - * interrupt IN endpoint must not overlap the bulk IN data buffer. |
77 | | - */ |
78 | | -#define PMA_CDC_OUT_ADDR PMA_CDC_OUT_BASE |
79 | | -#define PMA_CDC_IN_ADDR (PMA_CDC_OUT_BASE + USB_FS_MAX_PACKET_SIZE) |
80 | | -#define PMA_CDC_CMD_ADDR (PMA_CDC_IN_ADDR + USB_FS_MAX_PACKET_SIZE) |
81 | | -#else |
| 76 | +#if !defined(USBD_CDC_USE_SINGLE_BUFFER) |
82 | 77 | #define PMA_CDC_OUT_ADDR ((PMA_CDC_OUT_BASE + USB_FS_MAX_PACKET_SIZE) | \ |
83 | 78 | (PMA_CDC_OUT_BASE << 16U)) |
84 | 79 | #define PMA_CDC_IN_ADDR (PMA_CDC_OUT_BASE + USB_FS_MAX_PACKET_SIZE * 2) |
85 | | -#define PMA_CDC_CMD_ADDR (PMA_CDC_IN_ADDR + CDC_CMD_PACKET_SIZE) |
| 80 | +#else |
| 81 | +#define PMA_CDC_OUT_ADDR PMA_CDC_OUT_BASE |
| 82 | +#define PMA_CDC_IN_ADDR (PMA_CDC_OUT_BASE + USB_FS_MAX_PACKET_SIZE) |
86 | 83 | #endif |
| 84 | +#define PMA_CDC_CMD_ADDR (PMA_CDC_IN_ADDR + CDC_CMD_PACKET_SIZE) |
87 | 85 | #endif /* USBD_USE_CDC */ |
88 | 86 | #ifdef USBD_USE_HID_COMPOSITE |
89 | 87 | #define PMA_MOUSE_IN_ADDR (PMA_EP0_IN_ADDR + HID_MOUSE_EPIN_SIZE) |
|
0 commit comments