all project can run ok

This commit is contained in:
hathach
2013-09-13 22:30:11 +07:00
parent c71f5c6f1b
commit ad0ef2e266
11 changed files with 33 additions and 23 deletions

View File

@@ -89,9 +89,11 @@ uint32_t osal_tick_get(void);
typedef uint32_t osal_task_t;
tusb_error_t osal_task_create(osal_task_t *task);
#define OSAL_TASK_DEF(variable, name, code, stack_depth, prio) \
#define OSAL_TASK_DEF(code, stack_depth, prio) \
osal_task_t variable
#define OSAL_TASK_REF(name) (&name)
#define OSAL_TASK_FUNCTION(task_name) \
void task_name
@@ -176,6 +178,8 @@ typedef osal_queue_t * osal_queue_handle_t;
#define OSAL_QUEUE_DEF(name, queue_depth, type) \
osal_queue_t name
#define OSAL_QUEUE_REF(name) (&name)
osal_queue_handle_t osal_queue_create (osal_queue_t *p_queue);
void osal_queue_receive (osal_queue_handle_t const queue_hdl, void *p_data, uint32_t msec, tusb_error_t *p_error);
tusb_error_t osal_queue_send (osal_queue_handle_t const queue_hdl, const void * data);

View File

@@ -82,14 +82,16 @@ typedef struct {
unsigned portBASE_TYPE prio;
} osal_task_t;
#define OSAL_TASK_DEF(task_variable, task_name, task_code, task_stack_depth, task_prio) \
osal_task_t task_variable = {\
.name = task_name , \
#define OSAL_TASK_DEF(task_code, task_stack_depth, task_prio) \
osal_task_t osal_task_def_##task_code = {\
.name = #task_code , \
.code = task_code , \
.stack_depth = task_stack_depth , \
.prio = task_prio \
}
#define OSAL_TASK_REF(name) (&osal_task_def_##name)
static inline tusb_error_t osal_task_create(osal_task_t *task) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline tusb_error_t osal_task_create(osal_task_t *task)
{
@@ -208,6 +210,8 @@ typedef xQueueHandle osal_queue_handle_t;
.item_size = sizeof(type)\
}
#define OSAL_QUEUE_REF(name) (&name)
#define osal_queue_create(p_queue) \
xQueueCreate((p_queue)->depth, (p_queue)->item_size)

View File

@@ -88,7 +88,7 @@ static inline uint32_t osal_tick_get(void)
// OSAL_TASK_LOOP_ENG
// }
//--------------------------------------------------------------------+
#define OSAL_TASK_DEF(variable, name, code, stack_depth, prio)
#define OSAL_TASK_DEF(code, stack_depth, prio)
#define osal_task_create(x) TUSB_ERROR_NONE
#define OSAL_TASK_FUNCTION(task_func) \
@@ -267,6 +267,8 @@ typedef osal_queue_t * osal_queue_handle_t;
.item_size = sizeof(type)\
}
#define OSAL_QUEUE_REF(name) (&name)
static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue)
{