timer: Refactor tick_delta to use hardware-specific clock frequency
This commit is contained in:
parent
5f09049765
commit
40333f1a37
2 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue