turned magic number into constant

master
Elfein Landers 2022-08-06 20:32:22 -07:00
parent cbcdfbb5f2
commit e86bbfcfe5
1 changed files with 3 additions and 1 deletions

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,