PORT按CPU型号更简单
This commit is contained in:
@@ -29,6 +29,9 @@
|
||||
#include <os_sched.h>
|
||||
#endif /*INCLUDED_OS_SCHED_H*/
|
||||
|
||||
#ifndef INCLUDED_OS_ALIGN_H
|
||||
#include <os_align.h>
|
||||
#endif /*INCLUDED_OS_ALIGN_H*/
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------ */
|
||||
@@ -76,6 +79,18 @@ os_task_t* os_task_self(void){
|
||||
return (os_task_t*)g_os_sched_current_task_p;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------ */
|
||||
/* */
|
||||
|
||||
#define OS_TASK_DEF(Name, StackSize) \
|
||||
OS_ALIGNED(OS_ALIGN_SIZE) \
|
||||
static uint8_t Name##_Stack[StackSize]; \
|
||||
static os_task_t Name; \
|
||||
OS_NORETURN \
|
||||
static void Name##_TaskEntry(void* param)
|
||||
|
||||
#define OS_TASK_RUN(Name, Param, Ticks, Priority) \
|
||||
os_task_init(&Name, Name##_TaskEntry, Param, Name##_Stack, OS_ARRAY_SIZE(Name##_Stack), Ticks, Priority)
|
||||
|
||||
|
||||
#endif /*INCLUDED_OS_TASK_H*/
|
||||
|
||||
Reference in New Issue
Block a user