PORT按CPU型号更简单

This commit is contained in:
2026-05-27 23:30:31 +08:00
parent 21b3c925c2
commit dc144a5cf4
24 changed files with 2519 additions and 953 deletions
+15
View File
@@ -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*/