From d00655f598905f7855a2c54081373843c918fa1e Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 25 Apr 2014 15:16:52 +0700 Subject: 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 --- tinyusb/common/assertion.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tinyusb/common') 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 -- cgit v1.3.1