From 489b98cb933e1f4b164bf1172a405d22528d2b8b Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 8 Feb 2013 12:12:10 +0700 Subject: [PATCH] add TUSB_CFG_HOST_CONTROLLER_START_INDEX update usbh_init and test code for TUSB_CFG_HOST_CONTROLLER_START_INDEX clean up some --- demos/host/tusb_config.h | 2 + tests/test/host/test_usbh.c | 101 +++++++++++++++++-------------- tests/test/support/tusb_config.h | 2 + tinyusb/hal/hal.h | 7 +-- tinyusb/host/usbh.c | 59 +++++++++--------- tinyusb/osal/osal_freeRTOS.h | 8 +-- tinyusb/tusb_option.h | 4 ++ 7 files changed, 104 insertions(+), 79 deletions(-) diff --git a/demos/host/tusb_config.h b/demos/host/tusb_config.h index 846492670..deaa3227e 100644 --- a/demos/host/tusb_config.h +++ b/demos/host/tusb_config.h @@ -62,6 +62,8 @@ //------------- CORE/CONTROLLER -------------// #define TUSB_CFG_HOST_CONTROLLER_NUM 1 +#define TUSB_CFG_HOST_CONTROLLER_START_INDEX 0 + #define TUSB_CFG_HOST_DEVICE_MAX 1 #define TUSB_CFG_CONFIGURATION_MAX 1 diff --git a/tests/test/host/test_usbh.c b/tests/test/host/test_usbh.c index da435426c..59edf42e5 100644 --- a/tests/test/host/test_usbh.c +++ b/tests/test/host/test_usbh.c @@ -55,51 +55,8 @@ void tearDown(void) } //--------------------------------------------------------------------+ -// init, get_status +// get_status //--------------------------------------------------------------------+ -void test_usbh_init_hcd_failed(void) -{ - hcd_init_IgnoreAndReturn(TUSB_ERROR_HCD_FAILED); - TEST_ASSERT_EQUAL(TUSB_ERROR_HCD_FAILED, usbh_init()); -} - -void test_usbh_init_task_create_failed(void) -{ - for(uint32_t i=0; i