mirror of
https://gitee.com/cosyos/cosyos.git
synced 2026-08-18 09:08:13 +08:00
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/**************************************************************************//**
|
||
* @item CosyOS-III Kernel
|
||
* @file os_starter.c
|
||
* @brief 任务启动器(Starter)
|
||
* @author 迟凯峰
|
||
* @version V1.2.1
|
||
* @date 2025.04.09
|
||
******************************************************************************/
|
||
|
||
#include "os_var.h"
|
||
#include "os_api.h"
|
||
#include "sv_create.h"
|
||
#include "sv_task.h"
|
||
#include "ur_api.h"
|
||
|
||
#define _taskname "\xC8\xCE\xCE\xF1\xC6\xF4\xB6\xAF\xC6\xF7" /*!< "任务启动器" */
|
||
sCat2Str
|
||
(
|
||
SYSCFG_STARTERCREATE,
|
||
CreateTask(Starter, SYSCFG_TASKPRIORITY - (SYSCFG_DEBUGGING ? 4 : 2), SYSCFG_STACKSIZE_STARTER, 0, _taskname)
|
||
)
|
||
{
|
||
void start_hook(void);
|
||
#if OS_TIMINTTOTAL || OS_TIMQRYTOTAL
|
||
s_u8_t i;
|
||
#if OS_TIMINTTOTAL
|
||
i = OS_TIMINTTOTAL;
|
||
while(i--){
|
||
if(s_timint_handle[i]->hookortask){
|
||
sStartTask_TimInt(i);
|
||
}
|
||
}
|
||
#endif
|
||
#if OS_TIMQRYTOTAL
|
||
i = OS_TIMQRYTOTAL;
|
||
while(i--){
|
||
if(s_timqry_handle[i]->hookortask){
|
||
sStartTask_TimQry(i);
|
||
}
|
||
}
|
||
#endif
|
||
#endif
|
||
start_hook();
|
||
uDeleteTasking();
|
||
}
|
||
#undef _taskname
|