diff options
| author | hathach <[email protected]> | 2013-01-18 14:39:42 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-01-18 14:39:42 +0700 |
| commit | d8c8b9e38ad94ab84c24f22c2ecb79ce4d78b7ba (patch) | |
| tree | 1090e26f45a534e5113f28d82f8381eef274e358 /tinyusb/common/assertion.h | |
| parent | 7976e2fd55d33a0bf8a74a729eb246a8842d58ee (diff) | |
add ASSERT POINTER support
add hid host and separate hid host & device
update host project setting with EA4357 board
add para checking test for hid host
Diffstat (limited to 'tinyusb/common/assertion.h')
| -rw-r--r-- | tinyusb/common/assertion.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h index a1aa968e9..cf99622d8 100644 --- a/tinyusb/common/assertion.h +++ b/tinyusb/common/assertion.h @@ -98,7 +98,7 @@ extern "C" // Logical Assert //--------------------------------------------------------------------+ #define ASSERT(...) ASSERT_TRUE(__VA_ARGS__) -#define ASSERT_TRUE(condition , error) ASSERT_DEFINE( ,(condition), error, "%s", "evaluated to false") +#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") //--------------------------------------------------------------------+ @@ -129,6 +129,14 @@ extern "C" #define ASSERT_HEX_EQUAL(...) ASSERT_XXX_EQUAL("0x%x", __VA_ARGS__) #define ASSERT_HEX_WITHIN(...) ASSERT_XXX_WITHIN("0x%x", __VA_ARGS__) +//--------------------------------------------------------------------+ +// Pointer Assert +//--------------------------------------------------------------------+ +#define ASSSERT_PTR(...) ASSERT_PTR_NOT_NULL(__VA_ARGS__) +#define ASSERT_PTR_NOT_NULL(pointer, error) ASSERT_DEFINE( , NULL != (pointer), error, "%s", "pointer is NULL") +#define ASSSERT_PTR_NULL(pointer, error) ASSERT_DEFINE( , NULL == (pointer), error, "%s", "pointer is NULL") + + #ifdef __cplusplus } #endif |
