Skip to content

Commit 7268144

Browse files
committed
fix low-level USBD config bugs
Fix some bugs with tracking the active USB configuration in the low-level USBD code. Make config volatile. Reset config to zero on bus reset.
1 parent 81603cc commit 7268144

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

system/GD32F30x_firmware/GD32F30x_usbd_library/device/Include/usbd_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ typedef struct
176176
struct _usb_dev
177177
{
178178
/* basic parameters */
179-
uint8_t config;
179+
__IO uint8_t config;
180180
uint8_t dev_addr;
181181

182182
__IO uint8_t cur_status;

system/GD32F30x_firmware/GD32F30x_usbd_library/usbd/Source/usbd_lld_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ static void usbd_ep_reset (usb_dev *udev)
237237
USBD_DADDR = DADDR_USBEN;
238238

239239
udev->cur_status = (uint8_t)USBD_DEFAULT;
240+
udev->config = 0U;
240241
}
241242

242243
/*!

0 commit comments

Comments
 (0)