X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/f6ab9c9ababa2cf6e5c723b83ffb9362094054e8..f044ca812256b421e793c4335ce1ffed74710a70:/lunaix-os/hal/timer/hwtimer.c?ds=sidebyside diff --git a/lunaix-os/hal/timer/hwtimer.c b/lunaix-os/hal/timer/hwtimer.c index 3a79ca1..1a994f7 100644 --- a/lunaix-os/hal/timer/hwtimer.c +++ b/lunaix-os/hal/timer/hwtimer.c @@ -8,18 +8,21 @@ struct hwtimer* current_timer; ticks_t hwtimer_base_frequency() { + assert(current_timer); return current_timer->base_freq; } ticks_t hwtimer_current_systicks() { + assert(current_timer); return current_timer->systicks(); } ticks_t hwtimer_to_ticks(u32_t value, int unit) { + assert(current_timer); // in case system frequency is less than 1000Hz if (unit != TIME_MS) { return current_timer->running_freq * unit * value;