From e0cdab5bf7ab6c2f085a748f936afafbd94ca0d9 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 8 Mar 2020 16:28:21 +0700 Subject: [PATCH] fix stm32 fsdev epdesc --- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index a1f40d971..5eacbe655 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -323,29 +323,27 @@ void dcd_remote_wakeup(uint8_t rhport) remoteWakeCountdown = 4u; // required to be 1 to 15 ms, ESOF should trigger every 1ms. } -// I'm getting a weird warning about missing braces here that I don't -// know how to fix. -#if defined(__GNUC__) && (__GNUC__ >= 7) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wmissing-braces" -#endif static const tusb_desc_endpoint_t ep0OUT_desc = { - .wMaxPacketSize = CFG_TUD_ENDPOINT0_SIZE, - .bDescriptorType = TUSB_XFER_CONTROL, - .bEndpointAddress = 0x00 + .bLength = sizeof(tusb_desc_endpoint_t), + .bDescriptorType = TUSB_DESC_ENDPOINT, + + .bEndpointAddress = 0x00, + .bmAttributes = { .xfer = TUSB_XFER_CONTROL }, + .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE }, + .bInterval = 0 }; static const tusb_desc_endpoint_t ep0IN_desc = { - .wMaxPacketSize = CFG_TUD_ENDPOINT0_SIZE, - .bDescriptorType = TUSB_XFER_CONTROL, - .bEndpointAddress = 0x80 -}; + .bLength = sizeof(tusb_desc_endpoint_t), + .bDescriptorType = TUSB_DESC_ENDPOINT, -#if defined(__GNUC__) && (__GNUC__ >= 7) -#pragma GCC diagnostic pop -#endif + .bEndpointAddress = 0x80, + .bmAttributes = { .xfer = TUSB_XFER_CONTROL }, + .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE }, + .bInterval = 0 +}; static void dcd_handle_bus_reset(void) {