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 "serial.h"
|
||||||
#include "stlio.h"
|
#include "stlio.h"
|
||||||
|
|
||||||
volatile u32 timer_ticks = 0;
|
volatile u32 pit_timer_ticks = 0;
|
||||||
|
|
||||||
void inc_ticks(struct cpu_reg_state* cpu) {
|
void pit_inc_ticks(struct cpu_reg_state* cpu) {
|
||||||
timer_ticks++;
|
pit_timer_ticks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_wait(u32 time) {
|
void pit_timer_wait(u32 time) {
|
||||||
u32 ticks = time + timer_ticks;
|
u32 ticks = time + pit_timer_ticks;
|
||||||
while(timer_ticks < ticks);
|
while(pit_timer_ticks < ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pit_install_timer(void) {
|
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
|
||||||
}
|
}
|
||||||
|
4
pit.h
4
pit.h
@ -9,9 +9,9 @@
|
|||||||
#define PIT_TIME_DATA1 0x41
|
#define PIT_TIME_DATA1 0x41
|
||||||
#define PIT_TIME_DATA2 0x42
|
#define PIT_TIME_DATA2 0x42
|
||||||
|
|
||||||
void inc_ticks(struct cpu_reg_state*);
|
void pit_inc_ticks(struct cpu_reg_state*);
|
||||||
|
|
||||||
void timer_wait(u32);
|
void pit_timer_wait(u32);
|
||||||
|
|
||||||
void pit_install_timer(void);
|
void pit_install_timer(void);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user