diff options
| author | hathach <[email protected]> | 2025-07-09 15:06:26 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-07-09 16:01:11 +0700 |
| commit | e598972438a698e00bbf38a21bbe3744741be98d (patch) | |
| tree | a2b5514090546286cc8d767a970c5ccac172d47e /src | |
| parent | 386f5518992166dec0830659b21663aeddae4fc8 (diff) | |
add board_vbus_set() for samd21/d51 to enable usb host vbus
enable host example build for samd21/d51
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/microchip/samd/hcd_samd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/portable/microchip/samd/hcd_samd.c b/src/portable/microchip/samd/hcd_samd.c index cecaee0b0..1f4b2b233 100644 --- a/src/portable/microchip/samd/hcd_samd.c +++ b/src/portable/microchip/samd/hcd_samd.c @@ -171,7 +171,7 @@ static void samd_free_pipe(uint8_t pipe) USB->HOST.HostPipe[pipe].PSTATUSSET.reg = USB_HOST_PSTATUSSET_PFREEZE; USB->HOST.HostPipe[pipe].PCFG.reg &= ~USB_HOST_PCFG_PTYPE_Msk; USB->HOST.HostPipe[pipe].PINTENCLR.reg = USB_HOST_PINTENCLR_MASK; - memset((uint8_t*) &usb_pipe_table[pipe], 0, sizeof(usb_pipe_table[pipe])); + memset((uint8_t*)(uintptr_t) &usb_pipe_table[pipe], 0, sizeof(usb_pipe_table[pipe])); } static void samd_free_all_pipes(void) @@ -197,8 +197,7 @@ static bool samd_on_xfer(uint8_t pipe, xfer_result_t xfer_result) xfer_delta = 0; } - TU_LOG3( - "samd_on_xfer(%d, result=%d, xdelta=%d, rem=%d)\r\n", xfer_result, pipe, xfer_delta, pipe_status->xfer_remaining); + TU_LOG3("samd_on_xfer(%d, result=%d, xdelta=%d, rem=%d)\r\n", xfer_result, pipe, xfer_delta, pipe_status->xfer_remaining); // update pipe status if (xfer_delta > pipe_status->xfer_remaining) { @@ -390,10 +389,9 @@ void hcd_int_handler(uint8_t rhport, bool in_isr) } // Initialize controller to host mode -bool hcd_init(uint8_t rhport) -{ +bool hcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) { TU_ASSERT(rhport == 0); - + (void) rh_init; fake_fnum = 0; // reset to get in a clean state. |
