timer wait behavior is really fucked and debugging this is an awful pain so juust check todos
This commit is contained in:
parent
e3317e5d64
commit
1fb8c16514
6
pit.c
6
pit.c
@ -4,7 +4,7 @@
|
||||
#include "serial.h"
|
||||
#include "stlio.h"
|
||||
|
||||
u32 timer_ticks = 0;
|
||||
volatile u32 timer_ticks = 0;
|
||||
|
||||
void inc_ticks(struct cpu_reg_state* cpu) {
|
||||
timer_ticks++;
|
||||
@ -13,6 +13,10 @@ void inc_ticks(struct cpu_reg_state* cpu) {
|
||||
}
|
||||
}
|
||||
|
||||
void timer_wait(u32 time) {
|
||||
u32 ticks = time + timer_ticks;
|
||||
while(timer_ticks < ticks);
|
||||
}
|
||||
void pit_install_timer(void) {
|
||||
init_irq_handler(0, inc_ticks); // timer interrupt request falls into int 0
|
||||
}
|
Loading…
Reference in New Issue
Block a user