mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
sched/wdog: Replace periodcial timer with the wd_start_next.
This commit replaced periodical timer with the wd_start_next to improve the timing accuracy. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
9d1b958524
commit
efe2af643f
@@ -64,7 +64,7 @@ static void perf_update(wdparm_t arg)
|
|||||||
clock_t tick = (clock_t)LONG_MAX * TICK_PER_SEC / up_perf_getfreq();
|
clock_t tick = (clock_t)LONG_MAX * TICK_PER_SEC / up_perf_getfreq();
|
||||||
|
|
||||||
perf_gettime();
|
perf_gettime();
|
||||||
wd_start((FAR struct wdog_s *)arg, tick, perf_update, arg);
|
wd_start_next((FAR struct wdog_s *)arg, tick, perf_update, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ static void cpuload_callback(wdparm_t arg)
|
|||||||
{
|
{
|
||||||
FAR struct wdog_s *wdog = (FAR struct wdog_s *)arg;
|
FAR struct wdog_s *wdog = (FAR struct wdog_s *)arg;
|
||||||
nxsched_process_cpuload_ticks(CPULOAD_SAMPLING_PERIOD);
|
nxsched_process_cpuload_ticks(CPULOAD_SAMPLING_PERIOD);
|
||||||
wd_start(wdog, CPULOAD_SAMPLING_PERIOD, cpuload_callback, arg);
|
wd_start_next(wdog, CPULOAD_SAMPLING_PERIOD, cpuload_callback, arg);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ static void profil_timer_handler(wdparm_t arg)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
profil_timer_handler_cpu(prof);
|
profil_timer_handler_cpu(prof);
|
||||||
wd_start(&prof->timer, PROFTICK, profil_timer_handler, arg);
|
wd_start_next(&prof->timer, PROFTICK, profil_timer_handler, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user