timer: Refactor tick_delta to use hardware-specific clock frequency

This commit is contained in:
Liam Kerr 2026-05-02 03:19:15 +01:00
parent 5f09049765
commit 40333f1a37
2 changed files with 8 additions and 1 deletions

View file

@ -2,6 +2,13 @@
#define TIMER_H
#include <stdint.h>
/* Define your clock frequency here based on your hardware */
/* Example: 12.5 MHz for QEMU virt machine */
#define CLOCK_FREQ_HZ 12500000
/* Calculate ticks per millisecond */
#define TICKS_PER_MS (CLOCK_FREQ_HZ / 1000)
extern _Atomic uint64_t sys_ticks;
extern const uint64_t tick_delta;