diff options
| author | hathach <[email protected]> | 2019-05-15 18:21:41 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-15 18:21:41 +0700 |
| commit | c4b153925012e7c4fe28c745e5022820798a160d (patch) | |
| tree | 01c7d3ee839746922ddade2a372310c6fa055999 /src/common | |
| parent | 449a631a4a888146e8f68b6960f7fdb579fc5edf (diff) | |
| parent | 6e9324e29c3c2cc7ae36c0d7cbdb037e92ec9614 (diff) | |
Merge pull request #66 from hathach/develop
support makefile device example for all boards
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/compiler/tusb_compiler_gcc.h | 74 | ||||
| -rw-r--r-- | src/common/compiler/tusb_compiler_iar.h | 58 | ||||
| -rw-r--r-- | src/common/tusb_common.h | 143 | ||||
| -rw-r--r-- | src/common/tusb_compiler.h | 42 | ||||
| -rw-r--r-- | src/common/tusb_error.h | 2 | ||||
| -rw-r--r-- | src/common/tusb_fifo.c | 2 | ||||
| -rw-r--r-- | src/common/tusb_fifo.h | 2 | ||||
| -rw-r--r-- | src/common/tusb_timeout.h | 2 | ||||
| -rw-r--r-- | src/common/tusb_types.h | 2 | ||||
| -rw-r--r-- | src/common/tusb_verify.h | 5 |
10 files changed, 88 insertions, 244 deletions
diff --git a/src/common/compiler/tusb_compiler_gcc.h b/src/common/compiler/tusb_compiler_gcc.h deleted file mode 100644 index bb2d0b56b..000000000 --- a/src/common/compiler/tusb_compiler_gcc.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018, hathach (tinyusb.org) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * This file is part of the TinyUSB stack. - */ - -/** \ingroup Group_Compiler - * \defgroup Group_GCC GNU GCC - * @{ */ - -#ifndef _TUSB_COMPILER_GCC_H_ -#define _TUSB_COMPILER_GCC_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#define ALIGN_OF(x) __alignof__(x) - -// Specifies a minimum alignment for the variable or structure field, measured in bytes -#define ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes))) - -// Place variable in a specific section -#define ATTR_SECTION(sec_name) __attribute__ (( section(#sec_name) )) - -// Packed struct/variable into smallest possible size -#define ATTR_PACKED __attribute__ ((packed)) -#define ATTR_PREPACKED - -// The deprecated attribute results in a warning if the function is used. -#define ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) - -// The weak attribute causes the declaration to be emitted as a weak symbol rather than a global. -#define ATTR_WEAK __attribute__ ((weak)) - -// Function/Variable is meant to be possibly unused (thus no warning) -#define ATTR_UNUSED __attribute__ ((unused)) - -// TODO mcu specific -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define __n2be(x) __builtin_bswap32(x) ///< built-in function to convert 32-bit from native to Big Endian -#define __be2n(x) __n2be(x) ///< built-in function to convert 32-bit from Big Endian to native - -#define __n2be_16(u16) __builtin_bswap16(u16) -#define __be2n_16(u16) __n2be_16(u16) -#endif - -#ifdef __cplusplus - } -#endif - -#endif /* _TUSB_COMPILER_GCC_H_ */ - -/// @} diff --git a/src/common/compiler/tusb_compiler_iar.h b/src/common/compiler/tusb_compiler_iar.h deleted file mode 100644 index 326a40031..000000000 --- a/src/common/compiler/tusb_compiler_iar.h +++ /dev/null @@ -1,58 +0,0 @@ -/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * This file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_COMPILER_IAR_H_
-#define _TUSB_COMPILER_IAR_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define ALIGN_OF(x) __ALIGNOF__(x)
-#define ATTR_ALIGNED(bytes) _Pragma(XSTRING_(data_alignment=##bytes))
-//#define ATTR_SECTION(section) _Pragma((#section))
-#define ATTR_PREPACKED __packed
-#define ATTR_PACKED
-#define ATTR_DEPRECATED(mess)
-#define ATTR_WEAK __weak
-#define ATTR_UNUSED
-
-// built-in function to convert 32-bit Big-Endian to Little-Endian
-//#if __LITTLE_ENDIAN__
-#define __be2n __REV
-#define __n2be __be2n
-
-#define __n2be_16(u16) ((uint16_t) __REV16(u16))
-#define __be2n_16(u16) __n2be_16(u16)
-
-#error "IAR won't work due to '__packed' placement before struct"
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_COMPILER_IAR_H_ */
-
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index e687b8983..4b74bcfc0 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -1,7 +1,7 @@ /*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -38,65 +38,27 @@ //--------------------------------------------------------------------+
// Macros Helper
//--------------------------------------------------------------------+
-#define TU_ARRAY_SZIE(_arr) ( sizeof(_arr) / sizeof(_arr[0]) )
-#define TU_MIN(_x, _y) ( (_x) < (_y) ) ? (_x) : (_y) )
-#define TU_MAX(_x, _y) ( (_x) > (_y) ) ? (_x) : (_y) )
+#define TU_ARRAY_SZIE(_arr) ( sizeof(_arr) / sizeof(_arr[0]) )
+#define TU_MIN(_x, _y) ( (_x) < (_y) ) ? (_x) : (_y) )
+#define TU_MAX(_x, _y) ( (_x) > (_y) ) ? (_x) : (_y) )
-#define U16_HIGH_U8(u16) ((uint8_t) (((u16) >> 8) & 0x00ff))
-#define U16_LOW_U8(u16) ((uint8_t) ((u16) & 0x00ff))
-#define U16_TO_U8S_BE(u16) U16_HIGH_U8(u16), U16_LOW_U8(u16)
-#define U16_TO_U8S_LE(u16) U16_LOW_U8(u16), U16_HIGH_U8(u16)
+#define TU_U16_HIGH(u16) ((uint8_t) (((u16) >> 8) & 0x00ff))
+#define TU_U16_LOW(u16) ((uint8_t) ((u16) & 0x00ff))
+#define U16_TO_U8S_BE(u16) TU_U16_HIGH(u16), TU_U16_LOW(u16)
+#define U16_TO_U8S_LE(u16) TU_U16_LOW(u16), TU_U16_HIGH(u16)
-#define U32_B1_U8(u32) ((uint8_t) (((u32) >> 24) & 0x000000ff)) // MSB
-#define U32_B2_U8(u32) ((uint8_t) (((u32) >> 16) & 0x000000ff))
-#define U32_B3_U8(u32) ((uint8_t) (((u32) >> 8) & 0x000000ff))
-#define U32_B4_U8(u32) ((uint8_t) ((u32) & 0x000000ff)) // LSB
+#define U32_B1_U8(u32) ((uint8_t) (((u32) >> 24) & 0x000000ff)) // MSB
+#define U32_B2_U8(u32) ((uint8_t) (((u32) >> 16) & 0x000000ff))
+#define U32_B3_U8(u32) ((uint8_t) (((u32) >> 8) & 0x000000ff))
+#define U32_B4_U8(u32) ((uint8_t) ((u32) & 0x000000ff)) // LSB
-#define U32_TO_U8S_BE(u32) U32_B1_U8(u32), U32_B2_U8(u32), U32_B3_U8(u32), U32_B4_U8(u32)
-#define U32_TO_U8S_LE(u32) U32_B4_U8(u32), U32_B3_U8(u32), U32_B2_U8(u32), U32_B1_U8(u32)
+#define U32_TO_U8S_BE(u32) U32_B1_U8(u32), U32_B2_U8(u32), U32_B3_U8(u32), U32_B4_U8(u32)
+#define U32_TO_U8S_LE(u32) U32_B4_U8(u32), U32_B3_U8(u32), U32_B2_U8(u32), U32_B1_U8(u32)
-//------------- Bit -------------//
-#define TU_BIT(n) (1U << (n)) ///< n-th Bit
-#define TU_BIT_SET(x, n) ( (x) | TU_BIT(n) ) ///< set n-th bit of x to 1
-#define TU_BIT_CLEAR(x, n) ( (x) & (~TU_BIT(n)) ) ///< clear n-th bit of x
-#define TU_BIT_TEST(x, n) ( ((x) & TU_BIT(n)) ? true : false ) ///< check if n-th bit of x is 1
-
-//------------- Endian Conversion -------------//
-#define ENDIAN_BE(u32) \
- (uint32_t) ( (((u32) & 0xFF) << 24) | (((u32) & 0xFF00) << 8) | (((u32) >> 8) & 0xFF00) | (((u32) >> 24) & 0xFF) )
-
-#define ENDIAN_BE16(le16) ((uint16_t) ((U16_LOW_U8(le16) << 8) | U16_HIGH_U8(le16)) )
-
-//------------- Binary constant -------------//
-#if defined(__GNUC__) && !defined(__CC_ARM)
-
-#define TU_BIN8(x) ((uint8_t) (0b##x))
-#define TU_BIN16(b1, b2) ((uint16_t) (0b##b1##b2))
-#define TU_BIN32(b1, b2, b3, b4) ((uint32_t) (0b##b1##b2##b3##b4))
-
-#else
-
-// internal macro of B8, B16, B32
-#define _B8__(x) (((x&0x0000000FUL)?1:0) \
- +((x&0x000000F0UL)?2:0) \
- +((x&0x00000F00UL)?4:0) \
- +((x&0x0000F000UL)?8:0) \
- +((x&0x000F0000UL)?16:0) \
- +((x&0x00F00000UL)?32:0) \
- +((x&0x0F000000UL)?64:0) \
- +((x&0xF0000000UL)?128:0))
-
-#define TU_BIN8(d) ((uint8_t) _B8__(0x##d##UL))
-#define TU_BIN16(dmsb,dlsb) (((uint16_t)TU_BIN8(dmsb)<<8) + TU_BIN8(dlsb))
-#define TU_BIN32(dmsb,db2,db3,dlsb) \
- (((uint32_t)TU_BIN8(dmsb)<<24) \
- + ((uint32_t)TU_BIN8(db2)<<16) \
- + ((uint32_t)TU_BIN8(db3)<<8) \
- + TU_BIN8(dlsb))
-#endif
+#define TU_BIT(n) (1U << (n))
// for declaration of reserved field, make use of _TU_COUNTER_
-#define TU_RESERVED XSTRING_CONCAT_(reserved, _TU_COUNTER_)
+#define TU_RESERVED XSTRING_CONCAT_(reserved, _TU_COUNTER_)
//--------------------------------------------------------------------+
// INCLUDES
@@ -113,54 +75,28 @@ #include "tusb_option.h"
#include "tusb_compiler.h"
#include "tusb_verify.h"
-#include "tusb_error.h"
+#include "tusb_error.h" // TODO remove
#include "tusb_timeout.h"
#include "tusb_types.h"
//--------------------------------------------------------------------+
// INLINE FUNCTION
//--------------------------------------------------------------------+
-#ifndef __n2be_16 // TODO clean up
-#define __n2be_16(u16) ((uint16_t) ((U16_LOW_U8(u16) << 8) | U16_HIGH_U8(u16)) )
-#define __be2n_16(u16) __n2be_16(u16)
-#endif
-
#define tu_memclr(buffer, size) memset((buffer), 0, (size))
#define tu_varclr(_var) tu_memclr(_var, sizeof(*(_var)))
-static inline bool tu_mem_test_zero (void const* buffer, uint32_t size)
-{
- uint8_t const* p_mem = (uint8_t const*) buffer;
- for(uint32_t i=0; i<size; i++) if (p_mem[i] != 0) return false;
- return true;
-}
-
-
-//------------- Conversion -------------//
-static inline uint32_t tu_u32_from_u8(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4)
+static inline uint32_t tu_u32(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4)
{
return ( ((uint32_t) b1) << 24) + ( ((uint32_t) b2) << 16) + ( ((uint32_t) b3) << 8) + b4;
}
-static inline uint16_t tu_u16_from_u8(uint8_t high, uint8_t low)
+static inline uint16_t tu_u16(uint8_t high, uint8_t low)
{
return (((uint16_t) high) << 8) + low;
}
-static inline uint8_t tu_u16_high(uint16_t u16)
-{
- return (uint8_t) ( ((uint16_t) (u16 >> 8)) & 0x00ff);
-}
-
-static inline uint8_t tu_u16_low(uint16_t u16)
-{
- return (uint8_t) (u16 & 0x00ff);
-}
-
-static inline uint16_t tu_u16_le2be(uint16_t u16)
-{
- return ((uint16_t)(tu_u16_low(u16) << 8)) | tu_u16_high(u16);
-}
+static inline uint8_t tu_u16_high(uint16_t u16) { return (uint8_t) (((uint16_t) (u16 >> 8)) & 0x00ff); }
+static inline uint8_t tu_u16_low (uint16_t u16) { return (uint8_t) (u16 & 0x00ff); }
// Min
static inline uint8_t tu_min8 (uint8_t x, uint8_t y ) { return (x < y) ? x : y; }
@@ -175,9 +111,7 @@ static inline uint32_t tu_max32 (uint32_t x, uint32_t y) { return (x > y) ? x : // Align
static inline uint32_t tu_align32 (uint32_t value) { return (value & 0xFFFFFFE0UL); }
static inline uint32_t tu_align16 (uint32_t value) { return (value & 0xFFFFFFF0UL); }
-static inline uint32_t tu_align_n (uint32_t alignment, uint32_t value) { return value & ((uint32_t) ~(alignment-1)); }
static inline uint32_t tu_align4k (uint32_t value) { return (value & 0xFFFFF000UL); }
-
static inline uint32_t tu_offset4k(uint32_t value) { return (value & 0xFFFUL); }
//------------- Mathematics -------------//
@@ -190,7 +124,7 @@ static inline bool tu_within(uint32_t lower, uint32_t value, uint32_t upper) }
// log2 of a value is its MSB's position
-// TODO use clz
+// TODO use clz TODO remove
static inline uint8_t tu_log2(uint32_t value)
{
uint8_t result = 0;
@@ -203,9 +137,9 @@ static inline uint8_t tu_log2(uint32_t value) }
// Bit
-static inline uint32_t tu_bit_set(uint32_t value, uint8_t n) { return value | TU_BIT(n); }
+static inline uint32_t tu_bit_set (uint32_t value, uint8_t n) { return value | TU_BIT(n); }
static inline uint32_t tu_bit_clear(uint32_t value, uint8_t n) { return value & (~TU_BIT(n)); }
-static inline bool tu_bit_test(uint32_t value, uint8_t n) { return (value & TU_BIT(n)) ? true : false; }
+static inline bool tu_bit_test (uint32_t value, uint8_t n) { return (value & TU_BIT(n)) ? true : false; }
/*------------------------------------------------------------------*/
/* Count number of arguments of __VA_ARGS__
@@ -237,6 +171,35 @@ static inline bool tu_bit_test(uint32_t value, uint8_t n) { return (value & TU_B 9,8,7,6,5,4,3,2,1,0
#endif
+// To be removed
+//------------- Binary constant -------------//
+#if defined(__GNUC__) && !defined(__CC_ARM)
+
+#define TU_BIN8(x) ((uint8_t) (0b##x))
+#define TU_BIN16(b1, b2) ((uint16_t) (0b##b1##b2))
+#define TU_BIN32(b1, b2, b3, b4) ((uint32_t) (0b##b1##b2##b3##b4))
+
+#else
+
+// internal macro of B8, B16, B32
+#define _B8__(x) (((x&0x0000000FUL)?1:0) \
+ +((x&0x000000F0UL)?2:0) \
+ +((x&0x00000F00UL)?4:0) \
+ +((x&0x0000F000UL)?8:0) \
+ +((x&0x000F0000UL)?16:0) \
+ +((x&0x00F00000UL)?32:0) \
+ +((x&0x0F000000UL)?64:0) \
+ +((x&0xF0000000UL)?128:0))
+
+#define TU_BIN8(d) ((uint8_t) _B8__(0x##d##UL))
+#define TU_BIN16(dmsb,dlsb) (((uint16_t)TU_BIN8(dmsb)<<8) + TU_BIN8(dlsb))
+#define TU_BIN32(dmsb,db2,db3,dlsb) \
+ (((uint32_t)TU_BIN8(dmsb)<<24) \
+ + ((uint32_t)TU_BIN8(db2)<<16) \
+ + ((uint32_t)TU_BIN8(db3)<<8) \
+ + TU_BIN8(dlsb))
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h index 613db4d3d..0978d1c0f 100644 --- a/src/common/tusb_compiler.h +++ b/src/common/tusb_compiler.h @@ -1,7 +1,7 @@ /*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -43,27 +43,41 @@ #define _TU_COUNTER_ __LINE__
#endif
-//--------------------------------------------------------------------+
-// Compile-time Assert (use TU_VERIFY_STATIC to avoid name conflict)
-//--------------------------------------------------------------------+
+// Compile-time Assert
#if __STDC_VERSION__ >= 201112L
#define TU_VERIFY_STATIC _Static_assert
#else
#define TU_VERIFY_STATIC(const_expr, _mess) enum { XSTRING_CONCAT_(_verify_static_, _TU_COUNTER_) = 1/(!!(const_expr)) }
#endif
-// allow debugger to watch any module-wide variables anywhere
-#if CFG_TUSB_DEBUG
-#define STATIC_VAR
-#else
-#define STATIC_VAR static
-#endif
+//--------------------------------------------------------------------+
+// Compiler porting with Attribute and Endian
+//--------------------------------------------------------------------+
+#if defined(__GNUC__)
+ #define ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes)))
+ #define ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
+ #define ATTR_PACKED __attribute__ ((packed))
+ #define ATTR_PREPACKED
+ #define ATTR_WEAK __attribute__ ((weak))
+ #define ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
+ #define ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
+ // Endian conversion use well-known host to network (big endian) naming
+ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #define tu_htonl(u32) __builtin_bswap32(u32)
+ #define tu_ntohl(u32) __builtin_bswap32(u32)
-#if defined(__GNUC__)
- #include "compiler/tusb_compiler_gcc.h"
-#elif defined __ICCARM__
- #include "compiler/tusb_compiler_iar.h"
+ #define tu_htons(u16) __builtin_bswap16(u16)
+ #define tu_ntohs(u16) __builtin_bswap16(u16)
+ #else
+ #define tu_htonl(u32) (u32)
+ #define tu_ntohl(u32) (u32)
+
+ #define tu_htons(u16) (u16)
+ #define tu_ntohs(u16) (u16)
+ #endif
+#else
+ #error "Compiler attribute porting are required"
#endif
#endif /* _TUSB_COMPILER_H_ */
diff --git a/src/common/tusb_error.h b/src/common/tusb_error.h index 8dbfb0a58..e6313f7aa 100644 --- a/src/common/tusb_error.h +++ b/src/common/tusb_error.h @@ -1,7 +1,7 @@ /*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c index cdaa4ca78..e2ed51cd6 100644 --- a/src/common/tusb_fifo.c +++ b/src/common/tusb_fifo.c @@ -1,7 +1,7 @@ /*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/src/common/tusb_fifo.h b/src/common/tusb_fifo.h index b6fd3a70e..1b64f1dbd 100644 --- a/src/common/tusb_fifo.h +++ b/src/common/tusb_fifo.h @@ -1,7 +1,7 @@ /*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/src/common/tusb_timeout.h b/src/common/tusb_timeout.h index 83a4dac63..558742ff6 100644 --- a/src/common/tusb_timeout.h +++ b/src/common/tusb_timeout.h @@ -1,7 +1,7 @@ /*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h index 82b5a65c1..786533849 100644 --- a/src/common/tusb_types.h +++ b/src/common/tusb_types.h @@ -1,7 +1,7 @@ /*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/src/common/tusb_verify.h b/src/common/tusb_verify.h index 74bc41230..eecc95ccb 100644 --- a/src/common/tusb_verify.h +++ b/src/common/tusb_verify.h @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2018, hathach (tinyusb.org) + * Copyright (c) 2019 Ha Thach (tinyusb.org) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,11 +46,10 @@ extern "C" { #endif - //--------------------------------------------------------------------+ // TU_VERIFY Helper //--------------------------------------------------------------------+ -#if CFG_TUSB_DEBUG >= 1 +#if CFG_TUSB_DEBUG #include <stdio.h> #define _MESS_ERR(_err) printf("%s: %d: failed, error = %s\n", __func__, __LINE__, tusb_strerr[_err]) #define _MESS_FAILED() printf("%s: %d: failed\n", __func__, __LINE__) |
