more clean up

This commit is contained in:
hathach 2022-04-28 18:00:30 +07:00
parent a72d4e2462
commit 85dcb73774
4 changed files with 8 additions and 7 deletions

@ -1 +1 @@
Subproject commit aecced02e756f3a35805cacdd9be25976b6dd978
Subproject commit 6f76de3c0fb4679afc9f953cd4fec0637ebd2f15

View File

@ -1071,8 +1071,7 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
//--------------------------------------------------------------------+
// DCD Event Handler
//--------------------------------------------------------------------+
TU_ATTR_FAST_FUNC
void dcd_event_handler(dcd_event_t const * event, bool in_isr)
TU_ATTR_FAST_FUNC void dcd_event_handler(dcd_event_t const * event, bool in_isr)
{
switch (event->event_id)
{

View File

@ -1139,7 +1139,7 @@ enum {
//ENUM_HUB_GET_STATUS_1,
ENUM_HUB_CLEAR_RESET_1,
ENUM_ADDR0_DEVICE_DESC,
ENUM_RESET_2, // 2nd reset before set address
ENUM_RESET_2, // 2nd reset before set address (not used)
ENUM_HUB_GET_STATUS_2,
ENUM_HUB_CLEAR_RESET_2,
ENUM_SET_ADDR,
@ -1227,17 +1227,17 @@ static void process_enumeration(tuh_xfer_t* xfer)
}
break;
#if 0
case ENUM_RESET_2:
// XXX note used by now, but may be needed for some devices !?
// Reset device again before Set Address
TU_LOG2("Port reset \r\n");
TU_LOG2("Port reset2 \r\n");
if (_dev0.hub_addr == 0)
{
// connected directly to roothub
#if !CFG_TUH_RPI_PIO_USB // FIXME skip this reset for pio-usb
hcd_port_reset( _dev0.rhport );
osal_task_delay(RESET_DELAY);
hcd_port_reset_end(_dev0.rhport);
#endif
// TODO: fall through to SET ADDRESS, refactor later
}
#if CFG_TUH_HUB
@ -1249,6 +1249,7 @@ static void process_enumeration(tuh_xfer_t* xfer)
}
#endif
__attribute__((fallthrough));
#endif
case ENUM_SET_ADDR:
enum_request_set_addr();

View File

@ -135,6 +135,7 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
{
(void) rhport;
endpoint_t *ep = pio_usb_device_get_endpoint_by_address(ep_addr);
ep->has_transfer = false;
ep->stalled = true;
}