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

@@ -81,9 +81,9 @@ typedef struct {
unsigned portBASE_TYPE prio;
} osal_task_t;
#define OSAL_TASK_DEF(task_name, task_code, task_stack_depth, task_prio) \
osal_task_t task_name = {\
.name = #task_name , \
#define OSAL_TASK_DEF(task_variable, task_name, task_code, task_stack_depth, task_prio) \
osal_task_t task_variable = {\
.name = task_name , \
.code = task_code , \
.stack_depth = task_stack_depth , \
.prio = task_prio \
@@ -96,6 +96,12 @@ static inline tusb_error_t osal_task_create(osal_task_t *task)
TUSB_ERROR_NONE : TUSB_ERROR_OSAL_TASK_CREATE_FAILED;
}
static inline void osal_task_delay(uint32_t msec) ATTR_ALWAYS_INLINE;
static inline void osal_task_delay(uint32_t msec)
{
vTaskDelay(TUSB_CFG_OS_TICKS_PER_SECOND * msec);
}
#define OSAL_TASK_LOOP_BEGIN \
while(1) {