diff options
| author | hathach <[email protected]> | 2013-02-28 17:00:51 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-28 17:00:51 +0700 |
| commit | 795fe7468d35b62987cee07d35c7cf452447ea70 (patch) | |
| tree | 8be32c99910341d1b9671b8d047c26da04e1c697 /tinyusb | |
| parent | 82bd4719ce1ab3d67c6d5f32973312250b8a443c (diff) | |
start to add code for hcd_init test
change hcd_init signature (omit hostid)
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/common/common.h | 9 | ||||
| -rw-r--r-- | tinyusb/common/compiler/compiler.h | 10 | ||||
| -rw-r--r-- | tinyusb/common/compiler/compiler_gcc.h | 2 | ||||
| -rw-r--r-- | tinyusb/host/hcd.h | 2 | ||||
| -rw-r--r-- | tinyusb/host/usbh.c | 5 |
5 files changed, 14 insertions, 14 deletions
diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h index 0f02cb3f0..76e38c0a0 100644 --- a/tinyusb/common/common.h +++ b/tinyusb/common/common.h @@ -76,15 +76,6 @@ #include "core/std_descriptors.h" #include "core/std_request.h" -// TODO try to manipulate gcc cmd option instead -#ifndef _TEST_ - #define STATIC_ static - #define INLINE_ inline -#else - #define STATIC_ - #define INLINE_ -#endif - #define STRING_(x) #x // stringify without expand #define XSTRING_(x) STRING_(x) // expand then stringify #define STRING_CONCAT_(a, b) a##b // concat without expand diff --git a/tinyusb/common/compiler/compiler.h b/tinyusb/common/compiler/compiler.h index b3439f1b6..8eb01ef3e 100644 --- a/tinyusb/common/compiler/compiler.h +++ b/tinyusb/common/compiler/compiler.h @@ -51,6 +51,16 @@ #ifndef _TUSB_COMPILER_H_ #define _TUSB_COMPILER_H_ +#ifdef _TEST_ + #define ATTR_ALWAYS_INLINE + #define STATIC_ + #define INLINE_ +#else + #define STATIC_ static + #define INLINE_ inline +#endif + + #if defined(__GNUC__) #include "compiler_gcc.h" #elif defined __ICCARM__ // IAR compiler diff --git a/tinyusb/common/compiler/compiler_gcc.h b/tinyusb/common/compiler/compiler_gcc.h index 8732b6cef..b778f6b92 100644 --- a/tinyusb/common/compiler/compiler_gcc.h +++ b/tinyusb/common/compiler/compiler_gcc.h @@ -79,8 +79,10 @@ * @{ */ +#ifndef ATTR_ALWAYS_INLINE /// Generally, functions are not inlined unless optimization is specified. For functions declared inline, this attribute inlines the function even if no optimization level is specified #define ATTR_ALWAYS_INLINE __attribute__ ((always_inline)) +#endif /// The nonnull attribute specifies that some function parameters should be non-null pointers. f the compiler determines that a null pointer is passed in an argument slot marked as non-null, and the -Wnonnull option is enabled, a warning is issued. All pointer arguments are marked as non-null #define ATTR_NON_NULL __attribute__ ((nonull)) diff --git a/tinyusb/host/hcd.h b/tinyusb/host/hcd.h index 5eb705c77..0051b028e 100644 --- a/tinyusb/host/hcd.h +++ b/tinyusb/host/hcd.h @@ -66,7 +66,7 @@ typedef uint32_t pipe_handle_t; //--------------------------------------------------------------------+ // USBH-HCD API //--------------------------------------------------------------------+ -tusb_error_t hcd_init(uint8_t hostid) ATTR_WARN_UNUSED_RESULT; +tusb_error_t hcd_init() ATTR_WARN_UNUSED_RESULT; //--------------------------------------------------------------------+ // PIPE API diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index 960a5da2d..e860c3d24 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -88,10 +88,7 @@ tusb_error_t usbh_init(void) memclr_(usbh_device_info_pool, sizeof(usbh_device_info_t)*(TUSB_CFG_HOST_DEVICE_MAX+1)); - for(i=0; i<TUSB_CFG_HOST_CONTROLLER_NUM; i++) - { - ASSERT_STATUS( hcd_init(TUSB_CFG_HOST_CONTROLLER_START_INDEX+i) ); - } + ASSERT_STATUS( hcd_init() ); //------------- Enumeration & Reporter Task init -------------// ASSERT_STATUS( osal_task_create(&enum_task) ); |
