From 633f46432ff369be3b52d292736a01c23124f3d1 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 2 Mar 2018 15:39:49 +0700 Subject: clean up API --- tinyusb/hal/hal.h | 4 ++-- tinyusb/hal/hal_lpc11uxx.c | 4 ++-- tinyusb/hal/hal_lpc13uxx.c | 4 ++-- tinyusb/hal/hal_lpc175x_6x.c | 4 ++-- tinyusb/tusb.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tinyusb') diff --git a/tinyusb/hal/hal.h b/tinyusb/hal/hal.h index f395c6d23..696c5d423 100644 --- a/tinyusb/hal/hal.h +++ b/tinyusb/hal/hal.h @@ -64,10 +64,10 @@ void tusb_isr(uint8_t coreid); * @{ */ /** \brief Initialize USB controller hardware - * \returns \ref tusb_error_t type to indicate success or error condition. + * \returns true if succeedded * \note This function is invoked by \ref tusb_init as part of the initialization. */ -tusb_error_t hal_init(void); +bool hal_init(void); /** \brief Enable USB Interrupt on a specific USB Controller * \param[in] coreid is a zero-based index to identify USB controller's ID diff --git a/tinyusb/hal/hal_lpc11uxx.c b/tinyusb/hal/hal_lpc11uxx.c index f240597cc..066679a27 100644 --- a/tinyusb/hal/hal_lpc11uxx.c +++ b/tinyusb/hal/hal_lpc11uxx.c @@ -53,7 +53,7 @@ void hal_usb_int_disable(uint8_t coreid) NVIC_DisableIRQ(USB_IRQn); } -tusb_error_t hal_init(void) +bool hal_init(void) { // TODO remove magic number /* Enable AHB clock to the USB block and USB RAM. */ @@ -70,7 +70,7 @@ tusb_error_t hal_init(void) LPC_IOCON->PIO0_6 &= ~0x07; LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */ - return TUSB_ERROR_NONE; + return true; } void USB_IRQHandler(void) diff --git a/tinyusb/hal/hal_lpc13uxx.c b/tinyusb/hal/hal_lpc13uxx.c index a8969a2f7..9de859e6f 100644 --- a/tinyusb/hal/hal_lpc13uxx.c +++ b/tinyusb/hal/hal_lpc13uxx.c @@ -53,7 +53,7 @@ void hal_usb_int_disable(uint8_t coreid) NVIC_DisableIRQ(USB_IRQ_IRQn); } -tusb_error_t hal_init(void) +bool hal_init(void) { // TODO remove magic number LPC_SYSCON->SYSAHBCLKCTRL |= ((0x1<<14) | (0x1<<27)); /* Enable AHB clock to the USB block and USB RAM. */ @@ -69,7 +69,7 @@ tusb_error_t hal_init(void) LPC_IOCON->PIO0_6 &= ~0x07; LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */ - return TUSB_ERROR_NONE; + return true; } void USB_IRQHandler(void) diff --git a/tinyusb/hal/hal_lpc175x_6x.c b/tinyusb/hal/hal_lpc175x_6x.c index 32be8f3fe..3463a70db 100644 --- a/tinyusb/hal/hal_lpc175x_6x.c +++ b/tinyusb/hal/hal_lpc175x_6x.c @@ -56,7 +56,7 @@ void hal_usb_int_disable(uint8_t coreid) //--------------------------------------------------------------------+ // IMPLEMENTATION //--------------------------------------------------------------------+ -tusb_error_t hal_init(void) +bool hal_init(void) { enum { USBCLK_DEVCIE = 0x12, // AHB + Device @@ -97,7 +97,7 @@ tusb_error_t hal_init(void) while ((LPC_USB->USBClkSt & USBCLK_DEVCIE) != USBCLK_DEVCIE); #endif - return TUSB_ERROR_NONE; + return true; } void USB_IRQHandler(void) diff --git a/tinyusb/tusb.c b/tinyusb/tusb.c index 7adb5098c..6b3842029 100644 --- a/tinyusb/tusb.c +++ b/tinyusb/tusb.c @@ -42,7 +42,7 @@ tusb_error_t tusb_init(void) { - ASSERT_STATUS( hal_init() ) ; // hardware init + VERIFY( hal_init(), TUSB_ERROR_FAILED ) ; // hardware init #if MODE_HOST_SUPPORTED ASSERT_STATUS( usbh_init() ); // host stack init -- cgit v1.3.1