diff options
| author | hathach <[email protected]> | 2018-03-05 13:31:17 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-05 13:31:17 +0700 |
| commit | f9270ac5a4cf240a743a459646a0478827c49bee (patch) | |
| tree | c27654098e923e4af09fcb455b4da728344a8e18 /tinyusb | |
| parent | 84bce659b81db2c0ce079dd00818070048d1b1bc (diff) | |
clean up
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/osal/osal.h | 15 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 6 |
2 files changed, 8 insertions, 13 deletions
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index a5b8268fe..b85a7fbe1 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -78,18 +78,11 @@ #define OSAL_SUBTASK_INVOKED_AND_WAIT(subtask, status) status = subtask
//------------- Sub Task Assert -------------//
- #define SUBTASK_ASSERT_STATUS(sts) ASSERT_STATUS(sts)
- #define SUBTASK_ASSERT(condition) ASSERT(condition, TUSB_ERROR_OSAL_TASK_FAILED)
+ #define SUBTASK_ASSERT_STATUS(sts) VERIFY_STATUS(sts)
+ #define SUBTASK_ASSERT(condition) VERIFY(condition, TUSB_ERROR_OSAL_TASK_FAILED)
- #define _SUBTASK_ASSERT_ERROR_HANDLER(error, func_call) func_call; return error
-
- #define SUBTASK_ASSERT_STATUS_WITH_HANDLER(sts, func_call) \
- ASSERT_DEFINE_WITH_HANDLER(_SUBTASK_ASSERT_ERROR_HANDLER, func_call, tusb_error_t status = (tusb_error_t)(sts),\
- TUSB_ERROR_NONE == status, status, "%s", TUSB_ErrorStr[status])
-
- #define SUBTASK_ASSERT_WITH_HANDLER(condition, func_call) \
- ASSERT_DEFINE_WITH_HANDLER(_SUBTASK_ASSERT_ERROR_HANDLER, func_call, ,\
- condition, TUSB_ERROR_OSAL_TASK_FAILED, "%s", "evaluated to false")
+ #define SUBTASK_ASSERT_STATUS_WITH_HANDLER(sts, func_call) VERIFY_STATUS_HDLR(sts, func_call)
+ #define SUBTASK_ASSERT_WITH_HANDLER(condition, func_call) VERIFY_HDLR(condition, func_call)
#endif
#ifdef __cplusplus
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 7df9517cb..f2a5bc714 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -130,8 +130,7 @@ static inline osal_task_t osal_task_create(osal_func_t code, const char* name, u #define SUBTASK_RETURN(error) \
do { TASK_RESTART; return error; } while(0)
-#define _SUBTASK_ASSERT_ERROR_HANDLER(error, func_call) \
- do { func_call; TASK_RESTART; return error; } while(0)
+
#define SUBTASK_ASSERT_STATUS(sts) VERIFY_STATUS_HDLR(sts, TASK_RESTART)
@@ -142,6 +141,9 @@ static inline osal_task_t osal_task_create(osal_func_t code, const char* name, u #define SUBTASK_ASSERT_WITH_HANDLER(condition, func_call) VERIFY_HDLR(condition, func_call; TASK_RESTART)
/*
+#define _SUBTASK_ASSERT_ERROR_HANDLER(error, func_call) \
+ do { func_call; TASK_RESTART; return error; } while(0)
+
#define SUBTASK_ASSERT_STATUS(sts) \
ASSERT_DEFINE_WITH_HANDLER(_SUBTASK_ASSERT_ERROR_HANDLER, , tusb_error_t status = (tusb_error_t)(sts),\
TUSB_ERROR_NONE == status, status, "%s", TUSB_ErrorStr[status])
|
