projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename event macros to look like regular functions.
[bertos.git]
/
drv
/
timer.c
diff --git
a/drv/timer.c
b/drv/timer.c
index cef5e41de5ee1aa529d9c5367eb192e5d68d06a3..0bd5defef8e623c91a7a1607ae96f7c24bef180c 100755
(executable)
--- a/
drv/timer.c
+++ b/
drv/timer.c
@@
-15,6
+15,12
@@
/*
* $Log$
/*
* $Log$
+ * Revision 1.4 2004/06/06 18:25:44 bernie
+ * Rename event macros to look like regular functions.
+ *
+ * Revision 1.3 2004/06/06 17:18:42 bernie
+ * Fix \!CONFIG_KERN_SIGNALS code paths.
+ *
* Revision 1.2 2004/06/03 11:27:09 bernie
* Add dual-license information.
*
* Revision 1.2 2004/06/03 11:27:09 bernie
* Add dual-license information.
*
@@
-156,7
+162,7
@@
Timer *timer_abort(Timer *timer)
*/
void timer_delay(time_t time)
{
*/
void timer_delay(time_t time)
{
-#if
def
CONFIG_KERN_SIGNALS
+#if
defined(CONFIG_KERN_SIGNALS) &&
CONFIG_KERN_SIGNALS
Timer t;
ASSERT(!sig_check(SIG_SINGLE));
Timer t;
ASSERT(!sig_check(SIG_SINGLE));
@@
-164,13
+170,18
@@
void timer_delay(time_t time)
timer_set_delay(&t, time);
timer_add(&t);
sig_wait(SIG_SINGLE);
timer_set_delay(&t, time);
timer_add(&t);
sig_wait(SIG_SINGLE);
-#else
+
+#else /* !CONFIG_KERN_SIGNALS */
+
time_t start = timer_gettick();
time_t start = timer_gettick();
+ /* Busy wait */
while (timer_gettick() - start < time) { /* nop */ }
while (timer_gettick() - start < time) { /* nop */ }
-#endif
+
+#endif /* !CONFIG_KERN_SIGNALS */
}
}
+
/*!
* Wait for the specified amount of time (expressed in microseconds)
*/
/*!
* Wait for the specified amount of time (expressed in microseconds)
*/
@@
-188,7
+199,7
@@
void timer_udelay(utime_t usec_delay)
hptime_t start = timer_hw_hpread();
hptime_t delay = (uint32_t)usec_delay * TIMER_HW_HPTICKS_PER_SEC / 1000000ul;
hptime_t start = timer_hw_hpread();
hptime_t delay = (uint32_t)usec_delay * TIMER_HW_HPTICKS_PER_SEC / 1000000ul;
- while (timer_hw_hpread() - start < delay)
+ while (timer_hw_hpread() - start < delay)
{}
}
{}
}
@@
-230,7
+241,7
@@
DEFINE_TIMER_ISR
REMOVE((Node *)timer);
/* Execute the associated event */
REMOVE((Node *)timer);
/* Execute the associated event */
-
DOEVENT_INTR
(&timer->expire);
+
event_doIntr
(&timer->expire);
}
}
}
}