init: add OSINIT_TASK_READY

reason:
simplifying some code writing

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2024-09-06 09:00:20 +08:00 committed by Xiang Xiao
parent aeb98d9c05
commit 40ae660d30
2 changed files with 2 additions and 1 deletions

View File

@ -38,6 +38,7 @@
* initialization.
*/
#define OSINIT_TASK_READY() (g_nx_initstate >= OSINIT_TASKLISTS)
#define OSINIT_MM_READY() (g_nx_initstate >= OSINIT_MEMORY)
#define OSINIT_HW_READY() (g_nx_initstate >= OSINIT_HARDWARE)
#define OSINIT_OS_READY() (g_nx_initstate >= OSINIT_OSREADY)

View File

@ -62,7 +62,7 @@ bool sched_idletask(void)
* have been initialized and, in that case, rtcb may be NULL.
*/
DEBUGASSERT(rtcb != NULL || g_nx_initstate < OSINIT_TASKLISTS);
DEBUGASSERT(rtcb != NULL || !OSINIT_TASK_READY());
if (rtcb != NULL)
{
/* The IDLE task TCB is distinguishable by a few things: