From a53ffeb3dbc5a09eda6bf82303dea6ef83cbce97 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 13 Sep 2021 10:01:18 +0000 Subject: [PATCH] Extra "skip" check. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14760 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/rt/src/chvt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/os/rt/src/chvt.c b/os/rt/src/chvt.c index fde2f03e2..40c2c4408 100644 --- a/os/rt/src/chvt.c +++ b/os/rt/src/chvt.c @@ -144,6 +144,16 @@ static void vt_insert_first(virtual_timers_list_t *vtlp, /* Being the first element inserted in the list the alarm timer is started.*/ port_timer_start_alarm(chTimeAddX(vtlp->lasttime, delay)); + +#if !defined(CH_VT_RFCU_DISABLED) + /* Checking if a skip occurred.*/ + { + systime_t newnow = chVTGetSystemTimeX(); + if (chTimeDiffX(now, newnow) >= delay) { + chRFCUCollectFaultsI(CH_RFCU_VT_INSUFFICIENT_DELTA); + } + } +#endif } #endif /* CH_CFG_ST_TIMEDELTA > 0 */