From b2b53e61fbf7a449f1c3db78df0bb2beddb80984 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 6 Nov 2013 12:15:11 +0700 Subject: refractor dcd_controller_reset & hcd_controller_reset to hal_controller_reset --- tinyusb/host/ehci/ehci.c | 26 +++++++++++++------------- tinyusb/host/ehci/ehci.h | 3 --- 2 files changed, 13 insertions(+), 16 deletions(-) (limited to 'tinyusb/host') diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c index 643bf3443..322f17879 100644 --- a/tinyusb/host/ehci/ehci.c +++ b/tinyusb/host/ehci/ehci.c @@ -277,19 +277,19 @@ static tusb_error_t hcd_controller_stop(uint8_t hostid) return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE; } -tusb_error_t hcd_controller_reset(uint8_t hostid) -{ - ehci_registers_t* const regs = get_operational_register(hostid); - timeout_timer_t timeout; - -// NXP chip powered with non-host mode --> sts bit is not correctly reflected - regs->usb_cmd_bit.reset = 1; - - timeout_set(&timeout, 2); // should not take longer the time to stop controller - while( regs->usb_cmd_bit.reset && !timeout_expired(&timeout)) {} - - return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE; -} +//tusb_error_t hcd_controller_reset(uint8_t hostid) +//{ +// ehci_registers_t* const regs = get_operational_register(hostid); +// timeout_timer_t timeout; +// +//// NXP chip powered with non-host mode --> sts bit is not correctly reflected +// regs->usb_cmd_bit.reset = 1; +// +// timeout_set(&timeout, 2); // should not take longer the time to stop controller +// while( regs->usb_cmd_bit.reset && !timeout_expired(&timeout)) {} +// +// return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE; +//} //--------------------------------------------------------------------+ // CONTROL PIPE API diff --git a/tinyusb/host/ehci/ehci.h b/tinyusb/host/ehci/ehci.h index 015de9186..3a7bb98b7 100644 --- a/tinyusb/host/ehci/ehci.h +++ b/tinyusb/host/ehci/ehci.h @@ -469,9 +469,6 @@ typedef struct { }device[TUSB_CFG_HOST_DEVICE_MAX]; }ehci_data_t; -//For NXP's MCU, host/device mode must be set immediately after a reset -tusb_error_t hcd_controller_reset(uint8_t hostid) ATTR_WARN_UNUSED_RESULT; - #ifdef __cplusplus } #endif -- cgit v1.3.1