From f0ca90ae2594bbf21de5bb13351fcb0b1bfb9d4e Mon Sep 17 00:00:00 2001 From: Elfein Landers Date: Sat, 6 Aug 2022 20:32:22 -0700 Subject: [PATCH] turned magic number into constant --- ableos/src/arch/x86_64/interrupts.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ableos/src/arch/x86_64/interrupts.rs b/ableos/src/arch/x86_64/interrupts.rs index 38aa65b..8388be2 100644 --- a/ableos/src/arch/x86_64/interrupts.rs +++ b/ableos/src/arch/x86_64/interrupts.rs @@ -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,