author | Scott McNutt <smcnutt@psyent.com> | |
Thu, 1 Apr 2010 04:00:56 +0000 (00:00 -0400) | ||
committer | Scott McNutt <smcnutt@psyent.com> | |
Fri, 2 Apr 2010 16:28:41 +0000 (12:28 -0400) | ||
commit | d8bc0a2889700ba063598de6d4e7d135360b537e | |
tree | 78412b80d2152b3690723179897fc5113c108b8e | tree | snapshot (tar.xz tar.gz zip) |
parent | ed2941578480d30b413e081b6f1a5675d4afd9e2 | commit | diff |
nios2: Reload timer count in reset_timer()
When the timestamp is incremented via interrupt and the interrupt
period is greater than 1 msec, successive calls to get_timer() can
produce inaccurate timing since the interrupts are asynchronous
to the timing loop. For example, with an interrupt period of 10 msec
two successive calls to get_timer() could indicate an elapsed time
of 10 msec after only several hundred usecs -- depending on when
the next interrupt actually occurs. This behavior can cause
reliability issues with components such as CFI and NAND.
This can be remedied by calling reset_timer() prior to establishing
the base timestamp with get_timer(0), provided reset_timer()
resets the hardware timer (rather than simply resetting only the
timestamp). This has the effect of synchronizing the interrupts
(and the advance of the timestamp) with the timing loop.
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
When the timestamp is incremented via interrupt and the interrupt
period is greater than 1 msec, successive calls to get_timer() can
produce inaccurate timing since the interrupts are asynchronous
to the timing loop. For example, with an interrupt period of 10 msec
two successive calls to get_timer() could indicate an elapsed time
of 10 msec after only several hundred usecs -- depending on when
the next interrupt actually occurs. This behavior can cause
reliability issues with components such as CFI and NAND.
This can be remedied by calling reset_timer() prior to establishing
the base timestamp with get_timer(0), provided reset_timer()
resets the hardware timer (rather than simply resetting only the
timestamp). This has the effect of synchronizing the interrupts
(and the advance of the timestamp) with the timing loop.
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
cpu/nios2/interrupts.c | diff | blob | history |