aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/delta.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-10-25 09:34:25 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-10-25 09:34:25 +0000
commit902470d1c542735b989a727355744a974af43de4 (patch)
tree3b467b808f7323438f8a7625e02da3536dc52d62 /src/include/delta.h
parent8317685beb67ed9341bc83d03153580b816f452e (diff)
downloadChibiOS-902470d1c542735b989a727355744a974af43de4.tar.gz
ChibiOS-902470d1c542735b989a727355744a974af43de4.tar.bz2
ChibiOS-902470d1c542735b989a727355744a974af43de4.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@481 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/include/delta.h')
-rw-r--r--src/include/delta.h40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/include/delta.h b/src/include/delta.h
index 4d59c1a73..4d1c9ac23 100644
--- a/src/include/delta.h
+++ b/src/include/delta.h
@@ -25,8 +25,6 @@
#ifndef _DELTA_H_
#define _DELTA_H_
-#ifdef CH_USE_VIRTUAL_TIMERS
-
/** Virtual Timer callback function.*/
typedef void (*vtfunc_t)(void *);
@@ -37,17 +35,17 @@ typedef struct VirtualTimer VirtualTimer;
* @extends DeltaList
*/
struct VirtualTimer {
- /** Next timer in the delta list.*/
- VirtualTimer *vt_next;
- /** Previous timer in the delta list.*/
- VirtualTimer *vt_prev;
- /** Time delta before timeout.*/
- systime_t vt_dtime;
- /** Timer callback function pointer. The pointer is reset to zero after
- the callback is invoked.*/
- vtfunc_t vt_func;
- /** Timer callback function parameter.*/
- void *vt_par;
+ /** Next timer in the delta list.*/
+ VirtualTimer *vt_next;
+ /** Previous timer in the delta list.*/
+ VirtualTimer *vt_prev;
+ /** Time delta before timeout.*/
+ systime_t vt_dtime;
+ /** Timer callback function pointer. The pointer is reset to zero after
+ the callback is invoked.*/
+ vtfunc_t vt_func;
+ /** Timer callback function parameter.*/
+ void *vt_par;
};
/**
@@ -57,17 +55,19 @@ struct VirtualTimer {
* is often used in the code.
*/
typedef struct {
- /** Next timer in the list (the one that will be triggered next).*/
- VirtualTimer *dl_next;
- /** Last timer in the list.*/
- VirtualTimer *dl_prev;
- /** Not used but it must be set to -1.*/
- systime_t dl_dtime;
+ /** Next timer in the list (the one that will be triggered next).*/
+ VirtualTimer *dl_next;
+ /** Last timer in the list.*/
+ VirtualTimer *dl_prev;
+ /** Not used but it must be set to -1.*/
+ systime_t dl_dtime;
+ volatile systime_t dl_stime;
} DeltaList;
extern DeltaList dlist;
#define chVTDoTickI() { \
+ dlist.dl_stime++; \
if (&dlist != (DeltaList *)dlist.dl_next) { \
VirtualTimer *vtp; \
\
@@ -100,8 +100,6 @@ extern "C" {
/** Returns TRUE if the speciified timer is armed.*/
#define chVTIsArmedI(vtp) ((vtp)->vt_func != NULL)
-#endif /* CH_USE_VIRTUAL_TIMER */
-
#endif /* _DELTA_H_ */
/** @} */