diff --git a/tinyusb/host/hcd.c b/tinyusb/host/hcd.c index 4a510d678..25b378484 100644 --- a/tinyusb/host/hcd.c +++ b/tinyusb/host/hcd.c @@ -42,7 +42,6 @@ TUSB_Error_t hcd_init() { - return tERROR_NONE; } diff --git a/tinyusb/tusb.c b/tinyusb/tusb.c index 4b028e29f..6a3ddf387 100644 --- a/tinyusb/tusb.c +++ b/tinyusb/tusb.c @@ -32,15 +32,13 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * This file is part of the tiny usb stack. + * This file is part of the tinyUSB stack. */ #include "tusb.h" -TUSB_Error_t tusb_init(void) +TUSB_Error_t hal_init() { - /* HARDWARE INIT */ - // TODO usb abstract later /* Enable AHB clock to the USB block and USB RAM. */ LPC_SYSCON->SYSAHBCLKCTRL |= ((0x1<<14) | (0x1<<27)); @@ -52,6 +50,13 @@ TUSB_Error_t tusb_init(void) LPC_IOCON->PIO0_6 &= ~0x07; LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */ + return tERROR_NONE; +} + +TUSB_Error_t tusb_init(void) +{ + ASSERT_ERROR( hal_init() ) ; /* HARDWARE INIT */ + #ifdef CFG_TUSB_HOST ASSERT_ERROR( hcd_init() ); #endif @@ -60,5 +65,5 @@ TUSB_Error_t tusb_init(void) ASSERT_ERROR( dcd_init() ); #endif - return LPC_OK; + return tERROR_NONE; }