From 466063ac9eb0f4be4b794c1bb8af9ca07677b0f8 Mon Sep 17 00:00:00 2001 From: zouboan Date: Sun, 27 Mar 2022 17:21:52 +0800 Subject: [PATCH] sched/sched/sched_timerexpiration: change from sched_time to eventtime Co-authored-by: Petro Karashchenko --- boards/sim/sim/sim/configs/foc/defconfig | 1 + sched/sched/sched_timerexpiration.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boards/sim/sim/sim/configs/foc/defconfig b/boards/sim/sim/sim/configs/foc/defconfig index 781f2dba22..167e2aa974 100644 --- a/boards/sim/sim/sim/configs/foc/defconfig +++ b/boards/sim/sim/sim/configs/foc/defconfig @@ -82,6 +82,7 @@ CONFIG_READLINE_TABCOMPLETION=y CONFIG_SCHED_HAVE_PARENT=y CONFIG_SCHED_HPWORK=y CONFIG_SCHED_ONEXIT=y +CONFIG_SCHED_SPORADIC=y CONFIG_SCHED_WAITPID=y CONFIG_SIM_M32=y CONFIG_START_MONTH=6 diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c index a8999ed460..c58cc05ca6 100644 --- a/sched/sched/sched_timerexpiration.c +++ b/sched/sched/sched_timerexpiration.c @@ -205,8 +205,8 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks, * committed to updating the scheduler for this TCB. */ - sporadic->sched_time.tv_sec = g_sched_time.tv_sec; - sporadic->sched_time.tv_nsec = g_sched_time.tv_nsec; + sporadic->eventtime = SEC2TICK(g_sched_time.tv_sec) + + NSEC2TICK(g_sched_time.tv_nsec); /* Yes, check if the currently executing task has exceeded its * budget.