summaryrefslogtreecommitdiff
path: root/tinyusb/hal
diff options
context:
space:
mode:
Diffstat (limited to 'tinyusb/hal')
-rw-r--r--tinyusb/hal/hal_lpc43xx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tinyusb/hal/hal_lpc43xx.c b/tinyusb/hal/hal_lpc43xx.c
index f9e0921b6..fc7b78904 100644
--- a/tinyusb/hal/hal_lpc43xx.c
+++ b/tinyusb/hal/hal_lpc43xx.c
@@ -72,6 +72,8 @@ static tusb_error_t hal_controller_reset(uint8_t coreid)
tusb_error_t hal_init(void)
{
+ LPC_CREG->CREG0 &= ~(1<<5); /* Turn on the phy */
+
//------------- USB0 -------------//
#if TUSB_CFG_CONTROLLER_0_MODE
CGU_EnableEntity(CGU_CLKSRC_PLL0, DISABLE); /* Disable PLL first */
@@ -79,6 +81,7 @@ tusb_error_t hal_init(void)
CGU_EntityConnect(CGU_CLKSRC_XTAL_OSC, CGU_CLKSRC_PLL0);
CGU_EnableEntity(CGU_CLKSRC_PLL0, ENABLE); /* Enable PLL after all setting is done */
+
// reset controller & set role
ASSERT_STATUS( hal_controller_reset(0) );
@@ -118,8 +121,6 @@ tusb_error_t hal_init(void)
hal_interrupt_enable(1);
#endif
- LPC_CREG->CREG0 &= ~(1<<5); /* Turn on the phy */
-
return TUSB_ERROR_NONE;
}