mirror of
https://gitee.com/cosyos/cosyos.git
synced 2026-08-23 15:18:12 +08:00
39 lines
1000 B
C
39 lines
1000 B
C
/**************************************************************************//**
|
||
* @item CosyOS-III Kernel
|
||
* @file os_sysidle.c
|
||
* @brief 系统空闲任务(Sysidle)
|
||
* @author 迟凯峰
|
||
* @version V1.0.0
|
||
* @date 2025.02.08
|
||
******************************************************************************/
|
||
|
||
#include "os_var.h"
|
||
#include "os_api.h"
|
||
#include "sv_create.h"
|
||
#include "sv_task.h"
|
||
#include "ur_api.h"
|
||
|
||
uCreateTask(Sysidle, 0, MCUCFG_STACKSIZE_SYSIDLE, 0, 0)
|
||
{
|
||
void idle_hook(void);
|
||
while(true){
|
||
#if SYSCFG_SOFTRTC == __ENABLED__
|
||
static s_u8_t _RTC_MEM_ year = 0xFF;
|
||
if(year != s_rtc.year){
|
||
year = s_rtc.year;
|
||
s_month2day = year ? ((year & 3) ? 28 : 29) : ((s_rtc.yeah & 3) ? 28 : 29);
|
||
}
|
||
#endif
|
||
#if SYSCFG_SAFERUNTIME == __ENABLED__
|
||
s_sign_timeout = false;
|
||
#endif
|
||
#if SYSCFG_IDLEHOOK == __ENABLED__
|
||
idle_hook();
|
||
#endif
|
||
#if SYSCFG_LOWPOWERMODE == __ENABLED__
|
||
mSys_Idle;
|
||
#endif
|
||
OS_NOPx2;
|
||
}
|
||
}
|