summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2012-12-02 00:41:12 +0700
committerhathach <[email protected]>2012-12-02 00:41:12 +0700
commita636d75fc6c8af025a5f5a6229bd02334f82e976 (patch)
treeacfb718d9846f0f7e21030e5f67612256d53eb91 /tinyusb
parent8a1dee1b2e9085a66b8cfb3037509442e52cbb4e (diff)
extract hal_init
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/host/hcd.c1
-rw-r--r--tinyusb/tusb.c15
2 files changed, 10 insertions, 6 deletions
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;
}