diff options
Diffstat (limited to 'src/chinit.c')
-rw-r--r-- | src/chinit.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/chinit.c b/src/chinit.c index 9fa079e2c..c7c0c7735 100644 --- a/src/chinit.c +++ b/src/chinit.c @@ -58,4 +58,22 @@ void chSysInit(void) { chThdCreate(IDLEPRIO, 0, waIdleThread, sizeof(waIdleThread), (t_tfunc)_IdleThread, NULL);
}
+/**
+ * Preemption routine, this function must be called into an interrupt
+ * handler invoked by a system timer.
+ * The frequency of the timer determines the system tick granularity and,
+ * together with the \p CH_TIME_QUANTUM macro, the round robin interval.
+ */
+void chSysTimerHandlerI(void) {
+
+ rlist.r_preempt--;
+#ifdef CH_USE_SYSTEMTIME
+ rlist.r_stime++;
+#endif
+
+#ifdef CH_USE_VIRTUAL_TIMERS
+ chVTDoTickI();
+#endif
+}
+
/** @} */
|