diff options
| author | William D. Jones <[email protected]> | 2019-01-23 00:55:45 -0500 |
|---|---|---|
| committer | William D. Jones <[email protected]> | 2019-01-23 00:55:45 -0500 |
| commit | aa9a7e882c8eb0f5fb46be5cd84ffd98cb3cfb9c (patch) | |
| tree | ec2baabce49e18ba0f4c5c4e54eefa17719e44e7 /src/portable | |
| parent | 17e418bce4ae25a009b283d5475bec85ad1650ac (diff) | |
stm32f4: Properly set control endpoint max packet size.
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/stm/stm32f4/dcd_stm32f4.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/portable/stm/stm32f4/dcd_stm32f4.c b/src/portable/stm/stm32f4/dcd_stm32f4.c index 4adb52a76..53e0868a2 100644 --- a/src/portable/stm/stm32f4/dcd_stm32f4.c +++ b/src/portable/stm/stm32f4/dcd_stm32f4.c @@ -104,7 +104,13 @@ static void end_of_reset(void) { // Maximum packet size for EP 0 is set for both directions by writing // DIEPCTL. - in_ep[0].DIEPCTL |= enum_spd; + if(enum_spd == 0x03) { + // 64 bytes + in_ep[0].DIEPCTL &= ~(0x03 << USB_OTG_DIEPCTL_MPSIZ_Pos); + } else { + // 8 bytes + in_ep[0].DIEPCTL |= (0x03 << USB_OTG_DIEPCTL_MPSIZ_Pos); + } xfer_status[0][TUSB_DIR_OUT].max_size = 64; xfer_status[0][TUSB_DIR_IN].max_size = 64; } |
