Skip to content

Commit

Permalink
init: add OSINIT_TASK_READY
Browse files Browse the repository at this point in the history
reason:
simplifying some code writing

Change-Id: I21f633eb1e4f03828e819987dbf0fe93bff1c9c0
  • Loading branch information
hujun260 committed Sep 6, 2024
1 parent 608b59e commit 80f2d58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/nuttx/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sched/sched/sched_idletask.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 80f2d58

Please sign in to comment.