projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from kseries
[bertos.git]
/
drv
/
timer.c
diff --git
a/drv/timer.c
b/drv/timer.c
index 64eaf9443503a05ab2c814612b94f0072c7bbf88..24287cb982569748ea4e0165355aa1865ae0174b 100755
(executable)
--- a/
drv/timer.c
+++ b/
drv/timer.c
@@
-15,6
+15,15
@@
/*
* $Log$
/*
* $Log$
+ * Revision 1.11 2004/08/02 20:20:29 aleph
+ * Merge from project_ks
+ *
+ * Revision 1.10 2004/07/30 14:15:53 rasky
+ * Nuovo supporto unificato per detect della CPU
+ *
+ * Revision 1.9 2004/07/21 00:15:13 bernie
+ * Put timer driver on diet.
+ *
* Revision 1.8 2004/07/18 21:57:07 bernie
* Fix preprocessor warning with potentially undefined symbol.
*
* Revision 1.8 2004/07/18 21:57:07 bernie
* Fix preprocessor warning with potentially undefined symbol.
*
@@
-41,28
+50,22
@@
#include "hw.h"
#include "kdebug.h"
#include "timer.h"
#include "hw.h"
#include "kdebug.h"
#include "timer.h"
+#include CPU_HEADER(timer)
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
#include <kern/proc.h>
#endif
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
#include <kern/proc.h>
#endif
-#if defined(ARCH_EMUL) && (ARCH & ARCH_EMUL)
- #error To be recoded
-#elif defined(__AVR__)
- #include "timer_avr.h"
-#elif defined(__IAR_SYSTEMS_ICC) || defined(__IAR_SYSTEMS_ICC__) /* 80C196 */
- #include "timer_i196.h"
-#elif defined (__m56800__)
- #include "timer_dsp56k.h"
-#else
- #error Unknown system
-#endif
-
-
//! Master system clock (1ms accuracy)
volatile time_t _clock;
//! Master system clock (1ms accuracy)
volatile time_t _clock;
-REGISTER static List timers_queue; /*!< Active timers */
+
+#ifndef CONFIG_TIMER_DISABLE_EVENTS
+
+/*!
+ * List of active asynchronous timers.
+ */
+REGISTER static List timers_queue;
/*!
/*!
@@
-116,6
+119,8
@@
Timer *timer_abort(Timer *timer)
return timer;
}
return timer;
}
+#endif /* CONFIG_TIMER_DISABLE_EVENTS */
+
/*!
* Wait for the specified amount of time (expressed in ms)
/*!
* Wait for the specified amount of time (expressed in ms)
@@
-142,6
+147,7
@@
void timer_delay(time_t time)
}
}
+#ifndef CONFIG_TIMER_DISABLE_UDELAY
/*!
* Wait for the specified amount of time (expressed in microseconds)
*
/*!
* Wait for the specified amount of time (expressed in microseconds)
*
@@
-166,6
+172,7
@@
void timer_udelay(utime_t usec_delay)
while (timer_hw_hpread() - start < delay)
{}
}
while (timer_hw_hpread() - start < delay)
{}
}
+#endif /* CONFIG_TIMER_DISABLE_UDELAY */
/*!
/*!
@@
-174,14
+181,18
@@
void timer_udelay(utime_t usec_delay)
*/
DEFINE_TIMER_ISR
{
*/
DEFINE_TIMER_ISR
{
- /* With the Metrowerks compiler, the only way to force the compiler generate
- an interrupt service routine is to put a pragma directive within the function
- body. */
+ /*
+ * With the Metrowerks compiler, the only way to force the compiler generate
+ * an interrupt service routine is to put a pragma directive within the function
+ * body.
+ */
#ifdef __MWERKS__
#pragma interrupt saveall
#endif
#ifdef __MWERKS__
#pragma interrupt saveall
#endif
+#ifndef CONFIG_TIMER_DISABLE_EVENTS
Timer *timer;
Timer *timer;
+#endif
TIMER_STROBE_ON;
TIMER_STROBE_ON;
@@
-190,6
+201,7
@@
DEFINE_TIMER_ISR
/* Update the master ms counter */
++_clock;
/* Update the master ms counter */
++_clock;
+#ifndef CONFIG_TIMER_DISABLE_EVENTS
/*
* Check the first timer request in the list and process
* it when it has expired. Repeat this check until the
/*
* Check the first timer request in the list and process
* it when it has expired. Repeat this check until the
@@
-207,8
+219,9
@@
DEFINE_TIMER_ISR
REMOVE((Node *)timer);
/* Execute the associated event */
REMOVE((Node *)timer);
/* Execute the associated event */
- event_do
Intr
(&timer->expire);
+ event_do(&timer->expire);
}
}
+#endif /* CONFIG_TIMER_DISABLE_EVENTS */
TIMER_STROBE_OFF;
}
TIMER_STROBE_OFF;
}
@@
-221,7
+234,9
@@
void timer_init(void)
{
TIMER_STROBE_INIT;
{
TIMER_STROBE_INIT;
+#ifndef CONFIG_TIMER_DISABLE_EVENTS
INITLIST(&timers_queue);
INITLIST(&timers_queue);
+#endif
_clock = 0;
_clock = 0;