diff options
| author | hathach <[email protected]> | 2014-04-17 10:33:59 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-04-17 10:33:59 +0700 |
| commit | ccc65e620aeba998b274caf48a3880f3dca8de50 (patch) | |
| tree | 1b56588ca472c08a9e7ec6cf47dda824d312bdc4 /tinyusb/common/compiler | |
| parent | 5c6f8750daec8468fbaca1b208b8e83a2b575375 (diff) | |
change default TUSB_CFG_DEBUG to 0
change meaning of TUSB_CFG_DEBUG
Diffstat (limited to 'tinyusb/common/compiler')
| -rw-r--r-- | tinyusb/common/compiler/compiler.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tinyusb/common/compiler/compiler.h b/tinyusb/common/compiler/compiler.h index 98aa924ad..e628ce7c1 100644 --- a/tinyusb/common/compiler/compiler.h +++ b/tinyusb/common/compiler/compiler.h @@ -39,26 +39,30 @@ /** \ingroup Group_Common
* \defgroup Group_Compiler Compiler
* \brief Group_Compiler brief
- *
- * @{
- */
+ * @{ */
#ifndef _TUSB_COMPILER_H_
#define _TUSB_COMPILER_H_
#ifndef _TEST_
+ // TODO move some to tusb_option.h
#define STATIC_ static
#define INLINE_ inline
#define ATTR_TEST_WEAK
- #if TUSB_CFG_DEBUG == 3
- #define ATTR_ALWAYS_INLINE // no inline for debug = 3
+ // allow debugger to watch any module-wide variables anywhere
+ #if TUSB_CFG_DEBUG
#define STATIC_VAR
#else
#define STATIC_VAR static
#endif
-#else
+ // 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
@@ -73,4 +77,5 @@ #endif
#endif /* _TUSB_COMPILER_H_ */
+
/// @}
|
