summaryrefslogtreecommitdiff
path: root/tinyusb/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-04-25 15:16:52 +0700
committerhathach <[email protected]>2014-04-25 15:16:52 +0700
commitd00655f598905f7855a2c54081373843c918fa1e (patch)
tree4c0ebb4708e7684630a6ceb0ce98b2d3f25123f3 /tinyusb/common
parent1fb7106061624e27a82dad0f1edcf1caff1501c0 (diff)
cdc device app rename CDCD_APP_BUFFER_SIZE to SERIAL_BUFFER_SIZE
cdc host app add SERIAL_BUFFER_SIZE for buffer constant, add cdc data receive if cb with TUSB_EVENT_XFER_ERROR minor change to keyboard & mouse host app add ASSERT_FAILED & ASSERT_FAILED_MSG add cast to fix IAR build error with dcd_lpc43xx.c FreeRTOS - merge FreeRTOSConfig for m0, m3, m4 - re-implement application hook - support portmacro.h for m0
Diffstat (limited to 'tinyusb/common')
-rw-r--r--tinyusb/common/assertion.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h
index 3832c00c4..dd2fbdc67 100644
--- a/tinyusb/common/assertion.h
+++ b/tinyusb/common/assertion.h
@@ -68,9 +68,9 @@ extern "C"
// Assert Helper
//--------------------------------------------------------------------+
#ifndef _TEST_
- #define ASSERT_MESSAGE(format, ...) _PRINTF("Assert at %s: %s: %d: " format "\n", __BASE_FILE__, __func__ , __LINE__, __VA_ARGS__)
+ #define _ASSERT_MESSAGE(format, ...) _PRINTF("Assert at %s: %s: %d: " format "\n", __BASE_FILE__, __func__ , __LINE__, __VA_ARGS__)
#else // TODO remove this
- #define ASSERT_MESSAGE(format, ...) _PRINTF("%d:note: Assert " format "\n", __LINE__, __VA_ARGS__)
+ #define _ASSERT_MESSAGE(format, ...) _PRINTF("%d:note: Assert " format "\n", __LINE__, __VA_ARGS__)
#endif
#ifndef _TEST_ASSERT_
@@ -84,7 +84,7 @@ extern "C"
setup_statement;\
if (!(condition)) {\
hal_debugger_breakpoint();\
- ASSERT_MESSAGE(format, __VA_ARGS__);\
+ _ASSERT_MESSAGE(format, __VA_ARGS__);\
error_handler(error, handler_para);\
}\
}while(0)
@@ -108,6 +108,8 @@ extern "C"
#define ASSERT(...) ASSERT_TRUE(__VA_ARGS__)
#define ASSERT_TRUE(condition , error) ASSERT_DEFINE( , (condition), error, "%s", "evaluated to false")
#define ASSERT_FALSE(condition , error) ASSERT_DEFINE( ,!(condition), error, "%s", "evaluated to true")
+#define ASSERT_FAILED(error) ASSERT_DEFINE( , false, error, "%s", "FAILED")
+#define ASSERT_FAILED_MSG(error, msg) ASSERT_DEFINE( , false, error, "FAILED: %s", msg)
//--------------------------------------------------------------------+
// Pointer Assert