summaryrefslogtreecommitdiff
path: root/tinyusb/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-02-01 14:21:22 +0700
committerhathach <[email protected]>2013-02-01 14:21:22 +0700
commita25da9d3eec9e43b051a94dfe0418b0b5bb9c2d9 (patch)
tree4ad2a610dd30addc1e66031911180c72eb519f8c /tinyusb/common
parent7fc3e4f8fed38cd41574976fbfa21f8be43b2eba (diff)
house keeping
add some more logic for enum task
Diffstat (limited to 'tinyusb/common')
-rw-r--r--tinyusb/common/assertion.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h
index 8383b2f0e..4f3678a50 100644
--- a/tinyusb/common/assertion.h
+++ b/tinyusb/common/assertion.h
@@ -70,7 +70,8 @@ extern "C"
//--------------------------------------------------------------------+
#define ASSERT_FILENAME __FILE__
#define ASSERT_FUNCTION __PRETTY_FUNCTION__
-#define ASSERT_STATEMENT _PRINTF("assert at %s: %s :%d :\n", ASSERT_FILENAME, ASSERT_FUNCTION, __LINE__)
+#define ASSERT_STATEMENT(format, ...)\
+ _PRINTF("Assert at %s: %s:%d: " format "\n", ASSERT_FILENAME, ASSERT_FUNCTION, __LINE__, __VA_ARGS__)
#ifndef _TEST_ASSERT_
#define ASSERT_ERROR_HANDLE(x) return (x)
@@ -82,7 +83,7 @@ extern "C"
do{\
setup_statement;\
if (!(condition)) {\
- _PRINTF("Assert at %s: %s:%d: " format "\n", ASSERT_FILENAME, ASSERT_FUNCTION, __LINE__, __VA_ARGS__);\
+ ASSERT_STATEMENT(format, __VA_ARGS__);\
ASSERT_ERROR_HANDLE(error);\
}\
}while(0)