From 5429d214f4a3da3c78398f2a2f0584259bb981d7 Mon Sep 17 00:00:00 2001 From: Michael Mikonos Date: Thu, 2 Nov 2023 20:49:51 +0800 Subject: [PATCH] TaskFocusNext(): avoid resetting _task if sys_focus_task is NULL --- src/Kernel/Sched.ZC | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Kernel/Sched.ZC b/src/Kernel/Sched.ZC index 9d472dc3..ac4f2b2c 100755 --- a/src/Kernel/Sched.ZC +++ b/src/Kernel/Sched.ZC @@ -37,10 +37,14 @@ $HL,1$*/ U0 TaskFocusNext() { - CTask *task, *_task = sys_focus_task; + CTask *task, *_task; - sys_focus_task = NULL; - if (!_task) + if (sys_focus_task) + { + _task = sys_focus_task; + sys_focus_task = NULL; + } + else _task = sys_task; task = _task->next_task; do