From d2ab4db25ee95058131d3b6139f9bb89d16f9cd7 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 25 Jul 2018 16:56:57 +0700 Subject: add scsi start stop unit struct, improve device msc, correctly stall unsupported scsi command --- src/common/tusb_common.h | 3 +++ src/common/tusb_compiler.h | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/common') diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 58a18f25c..e8baa9de4 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -101,6 +101,9 @@ #endif +// for declaration of reserved field, make use of _TU_COUNTER_ +#define TU_RESERVED XSTRING_CONCAT_(reserved, _TU_COUNTER_) + /*------------------------------------------------------------------*/ /* Count number of arguments of __VA_ARGS__ * - reference https://groups.google.com/forum/#!topic/comp.std.c/d-6Mj5Lko_s diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h index 369c3121a..35a4cc928 100644 --- a/src/common/tusb_compiler.h +++ b/src/common/tusb_compiler.h @@ -49,19 +49,19 @@ #define STRING_CONCAT_(a, b) a##b ///< concat without expand #define XSTRING_CONCAT_(a, b) STRING_CONCAT_(a, b) ///< expand then concat +#if defined __COUNTER__ && __COUNTER__ != __COUNTER__ + #define _TU_COUNTER_ __COUNTER__ +#else + #define _TU_COUNTER_ __LINE__ +#endif + //--------------------------------------------------------------------+ // Compile-time Assert (use VERIFY_STATIC to avoid name conflict) //--------------------------------------------------------------------+ #if defined(__ICCARM__) || (__STDC_VERSION__ >= 201112L ) #define VERIFY_STATIC static_assert #else - #if defined __COUNTER__ && __COUNTER__ != __COUNTER__ - #define _VERIFY_COUNTER __COUNTER__ - #else - #define _VERIFY_COUNTER __LINE__ - #endif - - #define VERIFY_STATIC(const_expr, _mess) enum { XSTRING_CONCAT_(_verify_static_, _VERIFY_COUNTER) = 1/(!!(const_expr)) } + #define 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 -- cgit v1.3.1