|
From: kosmirror <kos...@us...> - 2025-07-29 15:16:52
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via c62573617e4718d48f0ac3fe0cb02d60b78bed32 (commit)
from abbef9219b1fc6ba8721cb059a6e969d4a946c9b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c62573617e4718d48f0ac3fe0cb02d60b78bed32
Author: Paul Cercueil <pa...@cr...>
Date: Thu Jul 10 00:36:06 2025 +0200
timer: Fine-tune timer rate
The seconds counter has been reported to drift quite significantly vs. a
wall clock. This is most likely because until now we considered that the
peripheral clock was a perfect 50.0 MHz, while in practice it is closer
to 49.9 MHz.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/kernel/timer.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/arch/dreamcast/kernel/timer.c b/kernel/arch/dreamcast/kernel/timer.c
index fe5e7853..58a7b067 100644
--- a/kernel/arch/dreamcast/kernel/timer.c
+++ b/kernel/arch/dreamcast/kernel/timer.c
@@ -65,8 +65,11 @@ typedef enum PCK_DIV {
#define TIMER_TPSC PCK_DIV_4
/* Timer IRQ priority levels (0-15) */
#define TIMER_PRIO 15
-/* Peripheral clock rate (50Mhz) */
-#define TIMER_PCK 50000000
+
+/* Peripheral clock rate (~49.9 Mhz).
+ * The main clock is not exactly 200 MHz, and has been measured at
+ * 199499520 Hz. The peripheral clock is a quarter of that. */
+#define TIMER_PCK (199499520 / 4)
/* Timer registers, indexed by Timer ID. */
static const unsigned tcors[] = { TCOR0, TCOR1, TCOR2 };
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|