stm32f4: Properly set control endpoint max packet size.

This commit is contained in:
William D. Jones 2019-01-23 00:55:45 -05:00
parent 17e418bce4
commit aa9a7e882c
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}