diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-20 07:53:26 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-20 07:53:26 +0000 |
commit | 2fdb15128fcabd5c25325cd320d32419a7710479 (patch) | |
tree | 730256a2da1ce70b61e55052474cf8b1d72a46b4 /os | |
parent | 390ed322cb8f40cb9250021cde5f48acb928d291 (diff) | |
download | ChibiOS-2fdb15128fcabd5c25325cd320d32419a7710479.tar.gz ChibiOS-2fdb15128fcabd5c25325cd320d32419a7710479.tar.bz2 ChibiOS-2fdb15128fcabd5c25325cd320d32419a7710479.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6002 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/kernel/include/chvt.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h index d87f6d110..6e30d903c 100644 --- a/os/kernel/include/chvt.h +++ b/os/kernel/include/chvt.h @@ -104,7 +104,7 @@ struct virtual_timer { * @api
*/
#define S2ST(sec) \
- ((systime_t)((sec) * CH_FREQUENCY))
+ ((systime_t)((uint32_t)(sec) * (uint32_t)CH_FREQUENCY))
/**
* @brief Milliseconds to system ticks.
@@ -117,7 +117,8 @@ struct virtual_timer { * @api
*/
#define MS2ST(msec) \
- ((systime_t)((((msec) * CH_FREQUENCY - 1L) / 1000L) + 1L))
+ ((systime_t)(((((uint32_t)(msec)) * ((uint32_t)CH_FREQUENCY) - 1UL) / \
+ 1000UL) + 1UL))
/**
* @brief Microseconds to system ticks.
@@ -130,7 +131,8 @@ struct virtual_timer { * @api
*/
#define US2ST(usec) \
- ((systime_t)((((usec) * CH_FREQUENCY - 1L) / 1000000L) + 1L))
+ ((systime_t)(((((uint32_t)(usec)) * ((uint32_t)CH_FREQUENCY) - 1UL) / \
+ 1000000UL) + 1UL))
/** @} */
/*===========================================================================*/
@@ -188,7 +190,7 @@ static inline systime_t chVTGetSystemTimeI(void) { chDbgCheckClassI();
- return vtlist.vt_time;
+ return vtlist.vt_systime;
}
/**
@@ -359,7 +361,7 @@ static inline void chVTDoTickI(void) { vtfunc_t fn = vtp->vt_func;
vtp->vt_func = (vtfunc_t)NULL;
vtp->vt_next->vt_prev = (void *)&vtlist;
- (&vtlist)->vt_next = vtp->vt_next;
+ vtlist.vt_next = vtp->vt_next;
chSysUnlockFromIsr();
fn(vtp->vt_par);
chSysLockFromIsr();
|