From 7230eceb4dd4c378306ec5e49824fb1ded378da1 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 23 Nov 2022 18:58:39 +0100 Subject: [PATCH] x86_64/Timer: Show explanatory message on static assertion fail --- kernel/src/arch/x86_64/Timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/arch/x86_64/Timer.cpp b/kernel/src/arch/x86_64/Timer.cpp index ef6aa72b..9add861b 100644 --- a/kernel/src/arch/x86_64/Timer.cpp +++ b/kernel/src/arch/x86_64/Timer.cpp @@ -9,7 +9,7 @@ const usize ARCH_TIMER_FREQ = 5; void Timer::arch_init() { constexpr u16 divisor = (u16)(base_frequency / (ARCH_TIMER_FREQ * 1000)); - static_assert(divisor >= 100); + static_assert(divisor >= 100, "ARCH_TIMER_FREQ is too high"); IO::outb(PIT_CHANNEL_0, (u8)(divisor & 0xFF)); IO::outb(0x80, 0); // short delay IO::outb(PIT_CHANNEL_0, (u8)((divisor & 0xFF00) >> 8));