1
0
Fork 0
forked from koniifer/ableos

turned magic number into constant

This commit is contained in:
Elfein Landers 2022-08-06 20:32:22 -07:00
parent 1ce64c6e35
commit f0ca90ae25

View file

@ -177,8 +177,10 @@ pub fn init_idt() {
IDT.load();
}
const PIT_MAX_FREQ: u32 = 1193180;
pub fn set_pit_frequency(pit: u16, freq: u32) {
let ret = (1193180 / freq).try_into();
let ret = (PIT_MAX_FREQ / freq).try_into();
let divisor: u16 = match ret {
Ok(div) => div,