diff options
| author | hathach <[email protected]> | 2018-03-29 13:11:36 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-29 13:11:36 +0700 |
| commit | 1d33d4e07247107af6e8a14467852ed56734924c (patch) | |
| tree | 75e6bc13e0180f51a8a32fe9a113eee9f4a18b50 /tinyusb/osal | |
| parent | c50da4962e47ee9139d66478a8c4809f4761e47b (diff) | |
assert clean up
Diffstat (limited to 'tinyusb/osal')
| -rw-r--r-- | tinyusb/osal/osal.h | 12 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index 83f2573a8..e74929de7 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -74,15 +74,15 @@ #define OSAL_SUBTASK_BEGIN
#define OSAL_SUBTASK_END return TUSB_ERROR_NONE;
- #define STASK_RETURN(_error) return _error;
- #define STASK_INVOKE(_subtask, _status) (_status) = _subtask
+ #define STASK_RETURN(_error) return _error;
+ #define STASK_INVOKE(_subtask, _status) (_status) = _subtask
//------------- Sub Task Assert -------------//
- #define STASK_ASSERT_STATUS(sts) VERIFY_STATUS(sts)
- #define STASK_ASSERT(condition) VERIFY(condition, TUSB_ERROR_OSAL_TASK_FAILED)
+ #define STASK_ASSERT_ERR(_err) VERIFY_STATUS(_err)
+ #define STASK_ASSERT_ERR_HDLR(_err, _func) VERIFY_STATUS_HDLR(_err, _func)
- #define STASK_ASSERT_STATUS_HDLR(sts, func_call) VERIFY_STATUS_HDLR(sts, func_call)
- #define STASK_ASSERT_HDLR(condition, func_call) VERIFY_HDLR(condition, func_call)
+ #define STASK_ASSERT(_cond) VERIFY(_cond, TUSB_ERROR_OSAL_TASK_FAILED)
+ #define STASK_ASSERT_HDLR(_cond, _func) VERIFY_HDLR(_cond, _func)
#endif
#ifdef __cplusplus
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 3dad86183..414352df1 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -125,11 +125,11 @@ static inline osal_task_t osal_task_create(osal_func_t code, const char* name, u //------------- Sub Task Assert -------------//
#define STASK_RETURN(error) do { TASK_RESTART; return error; } while(0)
-#define STASK_ASSERT_STATUS(sts) VERIFY_STATUS_HDLR(sts, TASK_RESTART)
-#define STASK_ASSERT_STATUS_HDLR(sts, func_call) VERIFY_STATUS_HDLR(sts, func_call; TASK_RESTART )
+#define STASK_ASSERT_ERR(_err) VERIFY_STATUS_HDLR(_err, TASK_RESTART)
+#define STASK_ASSERT_ERR_HDLR(_err, _func) VERIFY_STATUS_HDLR(_err, _func; TASK_RESTART )
-#define STASK_ASSERT(condition) VERIFY_HDLR(condition, TASK_RESTART)
-#define STASK_ASSERT_HDLR(condition, func_call) VERIFY_HDLR(condition, func_call; TASK_RESTART)
+#define STASK_ASSERT(_cond) VERIFY_HDLR(_cond, TASK_RESTART)
+#define STASK_ASSERT_HDLR(_cond, _func) VERIFY_HDLR(_cond, _func; TASK_RESTART)
//--------------------------------------------------------------------+
// QUEUE API
|
