summaryrefslogtreecommitdiff
path: root/tinyusb/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-02 19:00:03 +0700
committerhathach <[email protected]>2018-03-02 19:00:03 +0700
commitbc9274591fe4b1b21cbe85aa9a4ebf4e8d2723e9 (patch)
tree6cd40c5bd3db6dbfd272d425e62a4438a8245885 /tinyusb/common
parentacb01b5a2477b483b5fa51c325e9e80839b4f033 (diff)
clean up compiler
Diffstat (limited to 'tinyusb/common')
-rw-r--r--tinyusb/common/common.h2
-rw-r--r--tinyusb/common/compiler/compiler.h32
-rw-r--r--tinyusb/common/std_request.h1
-rw-r--r--tinyusb/common/tusb_types.h1
4 files changed, 7 insertions, 29 deletions
diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h
index a624b941f..9a37c6c97 100644
--- a/tinyusb/common/common.h
+++ b/tinyusb/common/common.h
@@ -115,13 +115,11 @@
#define arrcount(_arr) ( sizeof(_arr) / sizeof(_arr[0]) )
-static inline uint8_t const * descriptor_next(uint8_t const p_desc[]) ATTR_ALWAYS_INLINE ATTR_PURE;
static inline uint8_t const * descriptor_next(uint8_t const p_desc[])
{
return p_desc + p_desc[DESCRIPTOR_OFFSET_LENGTH];
}
-static inline uint8_t descriptor_typeof(uint8_t const p_desc[]) ATTR_ALWAYS_INLINE ATTR_PURE;
static inline uint8_t descriptor_typeof(uint8_t const p_desc[])
{
return p_desc[DESCRIPTOR_OFFSET_TYPE];
diff --git a/tinyusb/common/compiler/compiler.h b/tinyusb/common/compiler/compiler.h
index 0103bc945..bbdd6e50e 100644
--- a/tinyusb/common/compiler/compiler.h
+++ b/tinyusb/common/compiler/compiler.h
@@ -53,7 +53,7 @@
// Compile-time Assert
//--------------------------------------------------------------------+
#ifdef __ICCARM__
- #define STATIC_ASSERT static_assert
+ #define STATIC_ASSERT static_assert
#else
#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
#define _ASSERT_COUNTER __COUNTER__
@@ -64,32 +64,14 @@
#define STATIC_ASSERT(const_expr, message) enum { XSTRING_CONCAT_(static_assert_, _ASSERT_COUNTER) = 1/(!!(const_expr)) }
#endif
-#ifndef _TEST_
- // TODO move some to tusb_option.h
- #define STATIC_ static
- #define INLINE_ inline
- #define ATTR_TEST_WEAK
-
- // allow debugger to watch any module-wide variables anywhere
- #if TUSB_CFG_DEBUG
- #define STATIC_VAR
- #else
- #define STATIC_VAR static
- #endif
-
- // function will not be inline for easy step by step debugging
- #if TUSB_CFG_DEBUG >= 2
- #define ATTR_ALWAYS_INLINE
- #endif
-
-#else // TODO remove this, try to pass using compiler command option
- #define ATTR_ALWAYS_INLINE
- #define STATIC_
- #define STATIC_VAR
- #define INLINE_
-
+// allow debugger to watch any module-wide variables anywhere
+#if TUSB_CFG_DEBUG
+#define STATIC_VAR
+#else
+#define STATIC_VAR static
#endif
+
#if defined(__GNUC__)
#include "compiler_gcc.h"
#elif defined __ICCARM__ // IAR compiler
diff --git a/tinyusb/common/std_request.h b/tinyusb/common/std_request.h
index fc37a9c28..87d6e5d0f 100644
--- a/tinyusb/common/std_request.h
+++ b/tinyusb/common/std_request.h
@@ -70,7 +70,6 @@ typedef struct ATTR_PACKED{
STATIC_ASSERT( sizeof(tusb_control_request_t) == 8, "mostly compiler option issue");
// TODO move to somewhere suitable
-static inline uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient)
{
return ((uint8_t) (direction << 7)) | ((uint8_t) (type << 5)) | (recipient);
diff --git a/tinyusb/common/tusb_types.h b/tinyusb/common/tusb_types.h
index 7f774e13d..d156d5e02 100644
--- a/tinyusb/common/tusb_types.h
+++ b/tinyusb/common/tusb_types.h
@@ -203,7 +203,6 @@ enum {
INTERFACE_INVALID_NUMBER = 0xff
};
-static inline uint8_t std_class_code_to_index(uint8_t std_class_code) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t std_class_code_to_index(uint8_t std_class_code)
{
return (std_class_code <= TUSB_CLASS_AUDIO_VIDEO ) ? std_class_code :