Skip to content

Commit 40ae660

Browse files
hujun260xiaoxiang781216
authored andcommitted
init: add OSINIT_TASK_READY
reason: simplifying some code writing Signed-off-by: hujun5 <[email protected]>
1 parent aeb98d9 commit 40ae660

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include/nuttx/init.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* initialization.
3939
*/
4040

41+
#define OSINIT_TASK_READY() (g_nx_initstate >= OSINIT_TASKLISTS)
4142
#define OSINIT_MM_READY() (g_nx_initstate >= OSINIT_MEMORY)
4243
#define OSINIT_HW_READY() (g_nx_initstate >= OSINIT_HARDWARE)
4344
#define OSINIT_OS_READY() (g_nx_initstate >= OSINIT_OSREADY)

sched/sched/sched_idletask.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bool sched_idletask(void)
6262
* have been initialized and, in that case, rtcb may be NULL.
6363
*/
6464

65-
DEBUGASSERT(rtcb != NULL || g_nx_initstate < OSINIT_TASKLISTS);
65+
DEBUGASSERT(rtcb != NULL || !OSINIT_TASK_READY());
6666
if (rtcb != NULL)
6767
{
6868
/* The IDLE task TCB is distinguishable by a few things:

0 commit comments

Comments
 (0)