merge common define in osal/osal_cmsis_rtx.h & osal/osal_freeRTOS.h
This commit is contained in:
@@ -61,9 +61,6 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// TASK API
|
||||
//--------------------------------------------------------------------+
|
||||
#define OSAL_TASK_FUNCTION(task_func) \
|
||||
void task_func
|
||||
|
||||
typedef osThreadDef_t osal_task_t;
|
||||
|
||||
#define OSAL_TASK_DEF(task_code, task_stack_depth, task_prio) \
|
||||
@@ -79,38 +76,6 @@ static inline tusb_error_t osal_task_create(const osal_task_t *task)
|
||||
|
||||
#define osal_task_delay(msec) osDelay(msec)
|
||||
|
||||
#define OSAL_TASK_LOOP_BEGIN \
|
||||
while(1) {
|
||||
|
||||
#define OSAL_TASK_LOOP_END \
|
||||
}
|
||||
|
||||
//------------- Sub Task -------------//
|
||||
#define OSAL_SUBTASK_BEGIN // TODO refractor move
|
||||
#define OSAL_SUBTASK_END \
|
||||
return TUSB_ERROR_NONE;
|
||||
|
||||
#define SUBTASK_EXIT(error) return error;
|
||||
|
||||
#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_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")
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Semaphore API
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user