/**************************************************************************//**
 * @item     CosyOS-II Kernel
 * @file     os_main.c
 * @brief    主函数
 * @author   迟凯峰
 * @version  V1.3.0
 * @date     2024.01.23
 ******************************************************************************/

#include "os_link.h"

int main(void)
{
	s_tid_t i;
	#if OS_TIMINTTOTAL || OS_TIMQRYTOTAL
	void s_init_timing(void);
	s_init_timing();
	#endif
	for(i = 0; i < OS_TASKTOTAL + 1; i++){
		s_delay_loader[i] = 0;
		#if SYSCFG_SAFERUNTIME == __ENABLED__
		s_sign_timeout[i] = 0;
		#endif
	}
	init_hook();
	mSys_INIT;
	#if SYSCFG_DEBUGGING == __ENABLED__
	sStartTask_TimQry(OS_TMID_TASKMGR);
	#endif
	uStartTask(Starter, OS_STATUS_READY);
	uStartTask(Sysidle, OS_STATUS_READY);
	s_sign_return = false;
	s_sign_scheduling = true;
	mPendSV_Set;
	while(true);
}
