summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-03-20 00:17:39 +0700
committerGitHub <[email protected]>2022-03-20 00:17:39 +0700
commitae531a79f654d566790a4daae350730cdc0a01e9 (patch)
treea67cd9c595a0038f7eecf6f4fcaadf4064a9ac9b /src/portable
parent1915d69cb8da8372b35a5067420c57ddb65d2cb1 (diff)
parenta270d8d6236124244f5a1447d57b35f4cfa4909c (diff)
Merge pull request #1403 from hathach/host-edpt-xfer
Host edpt xfer
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/ehci/ehci.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c
index 8d420f26a..665f2380b 100644
--- a/src/portable/ehci/ehci.c
+++ b/src/portable/ehci/ehci.c
@@ -656,6 +656,26 @@ static void xfer_error_isr(uint8_t hostid)
}
}
+#if CFG_TUSB_DEBUG >= EHCI_DBG
+
+static inline void print_portsc(ehci_registers_t* regs)
+{
+ TU_LOG_HEX(EHCI_DBG, regs->portsc);
+ TU_LOG(EHCI_DBG, " Current Connect Status: %u\r\n", regs->portsc_bm.current_connect_status);
+ TU_LOG(EHCI_DBG, " Connect Status Change : %u\r\n", regs->portsc_bm.connect_status_change);
+ TU_LOG(EHCI_DBG, " Port Enabled : %u\r\n", regs->portsc_bm.port_enabled);
+ TU_LOG(EHCI_DBG, " Port Enabled Change : %u\r\n", regs->portsc_bm.port_enable_change);
+
+ TU_LOG(EHCI_DBG, " Port Reset : %u\r\n", regs->portsc_bm.port_reset);
+ TU_LOG(EHCI_DBG, " Port Power : %u\r\n", regs->portsc_bm.port_power);
+}
+
+#else
+
+#define print_portsc(_reg)
+
+#endif
+
//------------- Host Controller Driver's Interrupt Handler -------------//
void hcd_int_handler(uint8_t rhport)
{
@@ -675,9 +695,8 @@ void hcd_int_handler(uint8_t rhport)
if (int_status & EHCI_INT_MASK_PORT_CHANGE)
{
- uint32_t port_status = regs->portsc & EHCI_PORTSC_MASK_ALL;
-
- TU_LOG_HEX(EHCI_DBG, regs->portsc);
+ uint32_t const port_status = regs->portsc & EHCI_PORTSC_MASK_ALL;
+ print_portsc(regs);
if (regs->portsc_bm.connect_status_change)
{