From d875dc2cd3bf47d1b0f4c68f715ae89c30c39039 Mon Sep 17 00:00:00 2001 From: mariusmonton Date: Sun, 13 Jan 2019 01:33:28 +0100 Subject: [PATCH] comparator value explained --- tests/C/timer/timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/C/timer/timer.c b/tests/C/timer/timer.c index e9d2e6b..42bed04 100644 --- a/tests/C/timer/timer.c +++ b/tests/C/timer/timer.c @@ -22,7 +22,9 @@ void timer_ISR() { ticks++; if (ticks < 10) { timer_value = TIMER; - TIMER_CMP = timer_value + 590; // timer is in nanoseconds, set to 1 ms. + // timer is in nanoseconds, set to 1 ms. + // comparator value fixed to take into account number of instructions executed + TIMER_CMP = timer_value + 590; } }