further refactor of pit functions
now they are all prepended with pit_
This commit is contained in:
parent
3c8062ef17
commit
a9d947c51f
15
pit.c
15
pit.c
@ -4,16 +4,17 @@
|
||||
#include "serial.h"
|
||||
#include "stlio.h"
|
||||
|
||||
volatile u32 timer_ticks = 0;
|
||||
volatile u32 pit_timer_ticks = 0;
|
||||
|
||||
void inc_ticks(struct cpu_reg_state* cpu) {
|
||||
timer_ticks++;
|
||||
void pit_inc_ticks(struct cpu_reg_state* cpu) {
|
||||
pit_timer_ticks++;
|
||||
}
|
||||
|
||||
void timer_wait(u32 time) {
|
||||
u32 ticks = time + timer_ticks;
|
||||
while(timer_ticks < ticks);
|
||||
void pit_timer_wait(u32 time) {
|
||||
u32 ticks = time + pit_timer_ticks;
|
||||
while(pit_timer_ticks < ticks);
|
||||
}
|
||||
|
||||
void pit_install_timer(void) {
|
||||
init_irq_handler(0, inc_ticks); // timer interrupt request falls into int 0
|
||||
init_irq_handler(0, pit_inc_ticks); // timer interrupt request falls into irq 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user