change OSAL_TASK_DEF to decouple variable name with task name

implement osal_task_delay for freeRTOS & non_os
getting both no_os & freertos running with mouse + keyboard
This commit is contained in:
hathach
2013-04-25 16:41:00 +07:00
parent 1ae5484320
commit 3763e22c9a
8 changed files with 33 additions and 49 deletions

View File

@@ -87,7 +87,7 @@ static inline volatile uint32_t osal_tick_get(void)
// OSAL_TASK_LOOP_ENG
// }
//--------------------------------------------------------------------+
#define OSAL_TASK_DEF(name, code, stack_depth, prio)
#define OSAL_TASK_DEF(variable, name, code, stack_depth, prio)
#define osal_task_create(x) TUSB_ERROR_NONE
#define OSAL_TASK_FUNCTION(task_func) \
@@ -107,6 +107,16 @@ static inline volatile uint32_t osal_tick_get(void)
}\
return TUSB_ERROR_NONE;
#define osal_task_delay(msec) \
do {\
timeout = osal_tick_get();\
state = __LINE__; case __LINE__:\
if ( timeout + osal_tick_from_msec(msec) < osal_tick_get() ) /* time out */ \
return TUSB_ERROR_OSAL_WAITING;\
}while(0)
//------------- Sub Task -------------//
#define OSAL_SUBTASK_INVOKED_AND_WAIT(subtask, status) \
do {\