diff options
Diffstat (limited to 'os/rt/src')
-rw-r--r-- | os/rt/src/chvt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/os/rt/src/chvt.c b/os/rt/src/chvt.c index 1c5b2fea2..0667bf7c3 100644 --- a/os/rt/src/chvt.c +++ b/os/rt/src/chvt.c @@ -125,6 +125,13 @@ void chVTDoSetI(virtual_timer_t *vtp, sysinterval_t delay, vtp->prev = (virtual_timer_t *)&ch.vtlist;
vtp->delta = delay;
+#if CH_CFG_INTERVALS_SIZE > CH_CFG_ST_RESOLUTION
+ /* The delta could be too large for the physical timer to handle.*/
+ if (delay > (sysinterval_t)TIME_MAX_SYSTIME) {
+ delay = (sysinterval_t)TIME_MAX_SYSTIME;
+ }
+#endif
+
/* Being the first element in the list the alarm timer is started.*/
port_timer_start_alarm(chTimeAddX(ch.vtlist.lasttime, delay));
|