[Core] STM32_USB_USE_OTG1
=> USB_ENDPOINTS_ARE_REORDERABLE
(#17647)
This commit is contained in:
parent
88cfd55b8c
commit
543f54a483
6 changed files with 26 additions and 24 deletions
|
@ -177,7 +177,7 @@ static const USBEndpointConfig shared_ep_config = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#if STM32_USB_USE_OTG1
|
||||
#ifdef USB_ENDPOINTS_ARE_REORDERABLE
|
||||
typedef struct {
|
||||
size_t queue_capacity_in;
|
||||
size_t queue_capacity_out;
|
||||
|
@ -204,23 +204,22 @@ typedef struct {
|
|||
} usb_driver_config_t;
|
||||
#endif
|
||||
|
||||
#if STM32_USB_USE_OTG1
|
||||
#ifdef USB_ENDPOINTS_ARE_REORDERABLE
|
||||
/* Reusable initialization structure - see USBEndpointConfig comment at top of file */
|
||||
# define QMK_USB_DRIVER_CONFIG(stream, notification, fixedsize) \
|
||||
{ \
|
||||
.queue_capacity_in = stream##_IN_CAPACITY, .queue_capacity_out = stream##_OUT_CAPACITY, \
|
||||
.inout_ep_config = \
|
||||
{ \
|
||||
stream##_IN_MODE, /* Interrupt EP */ \
|
||||
NULL, /* SETUP packet notification callback */ \
|
||||
qmkusbDataTransmitted, /* IN notification callback */ \
|
||||
qmkusbDataReceived, /* OUT notification callback */ \
|
||||
stream##_EPSIZE, /* IN maximum packet size */ \
|
||||
stream##_EPSIZE, /* OUT maximum packet size */ \
|
||||
NULL, /* IN Endpoint state */ \
|
||||
NULL, /* OUT endpoint state */ \
|
||||
2, /* IN multiplier */ \
|
||||
NULL /* SETUP buffer (not a SETUP endpoint) */ \
|
||||
stream##_IN_MODE, /* Interrupt EP */ \
|
||||
NULL, /* SETUP packet notification callback */ \
|
||||
qmkusbDataTransmitted, /* IN notification callback */ \
|
||||
qmkusbDataReceived, /* OUT notification callback */ \
|
||||
stream##_EPSIZE, /* IN maximum packet size */ \
|
||||
stream##_EPSIZE, /* OUT maximum packet size */ \
|
||||
NULL, /* IN Endpoint state */ \
|
||||
NULL, /* OUT endpoint state */ \
|
||||
usb_lld_endpoint_fields /* USB driver specific endpoint fields */ \
|
||||
}, \
|
||||
.int_ep_config = \
|
||||
{ \
|
||||
|
@ -232,8 +231,7 @@ typedef struct {
|
|||
0, /* OUT maximum packet size */ \
|
||||
NULL, /* IN Endpoint state */ \
|
||||
NULL, /* OUT endpoint state */ \
|
||||
2, /* IN multiplier */ \
|
||||
NULL, /* SETUP buffer (not a SETUP endpoint) */ \
|
||||
usb_lld_endpoint_fields /* USB driver specific endpoint fields */ \
|
||||
}, \
|
||||
.config = { \
|
||||
.usbp = &USB_DRIVER, \
|
||||
|
@ -490,7 +488,7 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) {
|
|||
usbInitEndpointI(usbp, SHARED_IN_EPNUM, &shared_ep_config);
|
||||
#endif
|
||||
for (int i = 0; i < NUM_USB_DRIVERS; i++) {
|
||||
#if STM32_USB_USE_OTG1
|
||||
#ifdef USB_ENDPOINTS_ARE_REORDERABLE
|
||||
usbInitEndpointI(usbp, drivers.array[i].config.bulk_in, &drivers.array[i].inout_ep_config);
|
||||
#else
|
||||
usbInitEndpointI(usbp, drivers.array[i].config.bulk_in, &drivers.array[i].in_ep_config);
|
||||
|
@ -717,7 +715,7 @@ static const USBConfig usbcfg = {
|
|||
*/
|
||||
void init_usb_driver(USBDriver *usbp) {
|
||||
for (int i = 0; i < NUM_USB_DRIVERS; i++) {
|
||||
#if STM32_USB_USE_OTG1
|
||||
#ifdef USB_ENDPOINTS_ARE_REORDERABLE
|
||||
QMKUSBDriver *driver = &drivers.array[i].driver;
|
||||
drivers.array[i].inout_ep_config.in_state = &drivers.array[i].in_ep_state;
|
||||
drivers.array[i].inout_ep_config.out_state = &drivers.array[i].out_ep_state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue