diff options
| author | hathach <[email protected]> | 2013-02-06 13:15:12 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-06 13:15:12 +0700 |
| commit | a253e4d64846316610aa92b231e3371acd7428e6 (patch) | |
| tree | 91da937ea5d9ece52c5bc873d73458f7ede9f117 /tinyusb | |
| parent | e20025b54d16deccbd6e86433f31d80f5a976fd4 (diff) | |
fix TASK_ASSERT for osal_none.h
add TASK_ASSERT test for osal_none
integrate test project better with eclipse
- assert message--> info windows
- test fail --> error windows
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/common/assertion.h | 9 | ||||
| -rw-r--r-- | tinyusb/osal/osal.h | 2 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h index e8ce24c0a..f0f780fe9 100644 --- a/tinyusb/common/assertion.h +++ b/tinyusb/common/assertion.h @@ -68,8 +68,13 @@ extern "C" //--------------------------------------------------------------------+ // Assert Helper //--------------------------------------------------------------------+ -#define ASSERT_MESSAGE(format, ...)\ - _PRINTF("Assert at %s %s %d: " format "\n", __BASE_FILE__, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__) +#ifndef _TEST_ + #define ASSERT_MESSAGE(format, ...)\ + _PRINTF("Assert at %s: %s: %d: " format "\n", __BASE_FILE__, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__) +#else + #define ASSERT_MESSAGE(format, ...)\ + _PRINTF("%d:note: Assert " format "\n", __LINE__, __VA_ARGS__) +#endif #ifndef _TEST_ASSERT_ #define ASSERT_ERROR_HANDLER(x, para) return (x) diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index 2482695fa..21f322ba9 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -90,7 +90,7 @@ typedef uint32_t osal_task_t; #define TASK_ASSERT_STATUS_HANDLER(sts, func_call) \ ASSERT_DEFINE_WITH_HANDLER(TASK_ASSERT_ERROR_HANDLER, func_call, tusb_error_t status = (tusb_error_t)(sts),\ - TUSB_ERROR_NONE == status, status, "%s", TUSB_ErrorStr[status]) + TUSB_ERROR_NONE == status, (void) 0, "%s", TUSB_ErrorStr[status]) #define TASK_ASSERT_STATUS(sts) \ ASSERT_DEFINE(tusb_error_t status = (tusb_error_t)(sts),\ diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index e424d4143..fb699e828 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -91,7 +91,7 @@ uint32_t osal_tick_get(void); } #define TASK_ASSERT_ERROR_HANDLER(error, func_call) \ - func_call; state = 0; break + func_call; state = 0; return #define TASK_ASSERT_STATUS_HANDLER(sts, func_call) \ ASSERT_DEFINE_WITH_HANDLER(TASK_ASSERT_ERROR_HANDLER, func_call, tusb_error_t status = (tusb_error_t)(sts),\ |
