fix rp2040 chapter 9 TD 9.6 test

This commit is contained in:
hathach 2021-08-31 17:41:08 +07:00
parent d047b28aa2
commit ab0c3e8dd0
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
2 changed files with 9 additions and 7 deletions

View File

@ -323,7 +323,11 @@ bool mscd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t
if ( p_msc->stage == MSC_STAGE_CMD ) if ( p_msc->stage == MSC_STAGE_CMD )
{ {
// part of reset recovery (probably due to invalid CBW) -> prepare for new command // part of reset recovery (probably due to invalid CBW) -> prepare for new command
TU_ASSERT( prepare_cbw(rhport, p_msc) ); // Note: skip if already queued previously
if ( usbd_edpt_ready(rhport, p_msc->ep_out) )
{
TU_ASSERT( prepare_cbw(rhport, p_msc) );
}
} }
} }
} }

View File

@ -389,17 +389,15 @@ void dcd_remote_wakeup(uint8_t rhport)
// disconnect by disabling internal pull-up resistor on D+/D- // disconnect by disabling internal pull-up resistor on D+/D-
void dcd_disconnect(uint8_t rhport) void dcd_disconnect(uint8_t rhport)
{ {
pico_info("dcd_disconnect %d\n", rhport); (void) rhport;
assert(rhport == 0); usb_hw_clear->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
usb_hw_clear->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
} }
// connect by enabling internal pull-up resistor on D+/D- // connect by enabling internal pull-up resistor on D+/D-
void dcd_connect(uint8_t rhport) void dcd_connect(uint8_t rhport)
{ {
pico_info("dcd_connect %d\n", rhport); (void) rhport;
assert(rhport == 0); usb_hw_set->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
usb_hw_set->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/