You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/03/27 15:23:07 UTC

[incubator-nuttx] branch master updated: sched/sched/sched_timerexpiration: change from sched_time to eventtime

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 466063a  sched/sched/sched_timerexpiration: change from sched_time to eventtime
466063a is described below

commit 466063ac9eb0f4be4b794c1bb8af9ca07677b0f8
Author: zouboan <ff...@feedforward.com.cn>
AuthorDate: Sun Mar 27 17:21:52 2022 +0800

    sched/sched/sched_timerexpiration: change from sched_time to eventtime
    
    Co-authored-by: Petro Karashchenko <pe...@gmail.com>
---
 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 781f2db..167e2aa 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 a8999ed..c58cc05 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.