projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add demo application.
[bertos.git]
/
drv
/
timer.c
diff --git
a/drv/timer.c
b/drv/timer.c
index 28980c5d119d062de2a40ca7f4417a209aa21e0e..85175224cdc37e03190872217590fd4d27938249 100755
(executable)
--- a/
drv/timer.c
+++ b/
drv/timer.c
@@
-14,6
+14,12
@@
/*#*
*#* $Log$
/*#*
*#* $Log$
+ *#* Revision 1.30 2006/02/24 00:26:49 bernie
+ *#* Fixes for CONFIG_KERNEL.
+ *#*
+ *#* Revision 1.29 2006/02/17 22:24:07 bernie
+ *#* Add MOD_CHECK() checks.
+ *#*
*#* Revision 1.28 2006/02/10 12:32:52 bernie
*#* Update Copyright year.
*#*
*#* Revision 1.28 2006/02/10 12:32:52 bernie
*#* Update Copyright year.
*#*
@@
-46,6
+52,7
@@
#include <cfg/cpu.h>
#include <cfg/os.h>
#include <cfg/debug.h>
#include <cfg/cpu.h>
#include <cfg/os.h>
#include <cfg/debug.h>
+#include <cfg/module.h>
#include <appconfig.h>
/*
#include <appconfig.h>
/*
@@
-72,8
+79,13
@@
#include <drv/wdt.h>
#endif
#include <drv/wdt.h>
#endif
-#if CONFIG_KERNEL && CONFIG_KERN_SIGNALS
- #include <kern/proc.h>
+#if CONFIG_KERNEL
+ #include <config_kern.h>
+ #if CONFIG_KERN_SIGNALS
+ #include <kern/signal.h> /* sig_wait(), sig_check() */
+ #include <kern/proc.h> /* proc_current() */
+ #include <cfg/macros.h> /* BV() */
+ #endif
#endif
#endif
@@
-147,7
+159,7
@@
void timer_add(Timer *timer)
}
/* Enqueue timer request into the list */
}
/* Enqueue timer request into the list */
- INSERTBEFORE(&timer->link, &node->link);
+ INSERT
_
BEFORE(&timer->link, &node->link);
IRQ_RESTORE(flags);
}
IRQ_RESTORE(flags);
}
@@
-167,8
+179,8
@@
Timer *timer_abort(Timer *timer)
#endif /* CONFIG_TIMER_DISABLE_EVENTS */
#endif /* CONFIG_TIMER_DISABLE_EVENTS */
-/*
!
- * Wait for the specified amount of time
(expressed in ms)
.
+/*
*
+ * Wait for the specified amount of time
r ticks
.
*/
void timer_delayTicks(ticks_t delay)
{
*/
void timer_delayTicks(ticks_t delay)
{
@@
-182,7
+194,7
@@
void timer_delayTicks(ticks_t delay)
ASSERT(!sig_check(SIG_SINGLE));
timer_set_event_signal(&t, proc_current(), SIG_SINGLE);
ASSERT(!sig_check(SIG_SINGLE));
timer_set_event_signal(&t, proc_current(), SIG_SINGLE);
- timer_set
_d
elay(&t, delay);
+ timer_set
D
elay(&t, delay);
timer_add(&t);
sig_wait(SIG_SINGLE);
timer_add(&t);
sig_wait(SIG_SINGLE);
@@
-303,6
+315,7
@@
DEFINE_TIMER_ISR
TIMER_STROBE_OFF;
}
TIMER_STROBE_OFF;
}
+MOD_DEFINE(timer)
/*!
* Initialize timer
/*!
* Initialize timer
@@
-318,4
+331,6
@@
void timer_init(void)
_clock = 0;
timer_hw_init();
_clock = 0;
timer_hw_init();
+
+ MOD_INIT(timer);
}
}