git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: device subsystem rework
[lunaix-os.git]
/
lunaix-os
/
hal
/
timer
/
hwtimer.c
diff --git
a/lunaix-os/hal/timer/hwtimer.c
b/lunaix-os/hal/timer/hwtimer.c
index 3a79ca1a7ec6d773521e8f8b7ff321b04526d406..1a994f7d3d163dcce4abaec3c9d5d530f3875bf1 100644
(file)
--- 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()
{
ticks_t
hwtimer_base_frequency()
{
+ assert(current_timer);
return current_timer->base_freq;
}
ticks_t
hwtimer_current_systicks()
{
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)
{
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;
// in case system frequency is less than 1000Hz
if (unit != TIME_MS) {
return current_timer->running_freq * unit * value;