From b555c91cd32df70ad6de56895d3ff0a5968c4630 Mon Sep 17 00:00:00 2001 From: bernie Date: Sun, 6 Jun 2004 17:18:42 +0000 Subject: [PATCH] Fix \!CONFIG_KERN_SIGNALS code paths. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@26 38d2e660-2303-0410-9eaa-f027e97ec537 --- drv/timer.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drv/timer.c b/drv/timer.c index cef5e41d..a6c31d92 100755 --- a/drv/timer.c +++ b/drv/timer.c @@ -15,6 +15,9 @@ /* * $Log$ + * 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. * @@ -156,7 +159,7 @@ Timer *timer_abort(Timer *timer) */ void timer_delay(time_t time) { -#ifdef CONFIG_KERN_SIGNALS +#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS Timer t; ASSERT(!sig_check(SIG_SINGLE)); @@ -164,13 +167,18 @@ void timer_delay(time_t time) timer_set_delay(&t, time); timer_add(&t); sig_wait(SIG_SINGLE); -#else + +#else /* !CONFIG_KERN_SIGNALS */ + time_t start = timer_gettick(); + /* Busy wait */ while (timer_gettick() - start < time) { /* nop */ } -#endif + +#endif /* !CONFIG_KERN_SIGNALS */ } + /*! * Wait for the specified amount of time (expressed in microseconds) */ @@ -188,7 +196,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; - while (timer_hw_hpread() - start < delay) + while (timer_hw_hpread() - start < delay) {} } -- 2.25.1