1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-04-24 19:50:31 +00:00

USB: handle HUB port error changes

This commit is contained in:
Gyorgy Szombathelyi
2024-01-05 01:59:11 +01:00
parent cc01a3241f
commit fd51a0dccd
2 changed files with 3 additions and 1 deletions

View File

@@ -184,7 +184,7 @@ static void usb_hub_show_port_status(uint8_t port, uint16_t status, uint16_t cha
iprintf("Changes on port %d:\n", port);
if(changed & USB_HUB_PORT_STATUS_PORT_CONNECTION) puts(" connected");
if(changed & USB_HUB_PORT_STATUS_PORT_ENABLE) puts(" enabled");
if(changed & USB_HUB_PORT_STATUS_PORT_ENABLE) puts(" error");
if(changed & USB_HUB_PORT_STATUS_PORT_SUSPEND) puts(" suspended");
if(changed & USB_HUB_PORT_STATUS_PORT_OVER_CURRENT) puts(" over current");
if(changed & USB_HUB_PORT_STATUS_PORT_RESET) puts(" reset");
@@ -221,6 +221,7 @@ static uint8_t usb_hub_port_status_change(usb_device_t *dev, uint8_t port, hub_e
// Device disconnected event
case USB_HUB_PORT_EVENT_DISCONNECT:
case USB_HUB_PORT_EVENT_DISCONNECT_ERROR:
iprintf(" port %d disconnect!\n", port);
usb_hub_clear_port_feature(dev, HUB_FEATURE_C_PORT_ENABLE, port, 0);

View File

@@ -68,6 +68,7 @@ typedef struct {
// Hub Port Events
#define USB_HUB_PORT_EVENT_CONNECT (((0UL | USB_HUB_PORT_STATUS_PORT_CONNECTION) << 16) | USB_HUB_PORT_STATUS_PORT_POWER | USB_HUB_PORT_STATUS_PORT_CONNECTION)
#define USB_HUB_PORT_EVENT_DISCONNECT (((0UL | USB_HUB_PORT_STATUS_PORT_CONNECTION) << 16) | USB_HUB_PORT_STATUS_PORT_POWER)
#define USB_HUB_PORT_EVENT_DISCONNECT_ERROR (((0UL | USB_HUB_PORT_STATUS_PORT_ENABLE | USB_HUB_PORT_STATUS_PORT_CONNECTION) << 16) | USB_HUB_PORT_STATUS_PORT_POWER)
#define USB_HUB_PORT_EVENT_RESET_COMPLETE (((0UL | USB_HUB_PORT_STATUS_PORT_RESET) << 16) | USB_HUB_PORT_STATUS_PORT_POWER | USB_HUB_PORT_STATUS_PORT_ENABLE | USB_HUB_PORT_STATUS_PORT_CONNECTION)
#define USB_HUB_PORT_EVENT_LS_CONNECT (((0UL | USB_HUB_PORT_STATUS_PORT_CONNECTION) << 16) | USB_HUB_PORT_STATUS_PORT_POWER | USB_HUB_PORT_STATUS_PORT_CONNECTION | USB_HUB_PORT_STATUS_PORT_LOW_SPEED)