diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-30 09:19:07 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-30 09:19:07 +0000 |
commit | 9cd24294b8b5c32af4f64762eb99868b1a5c7b75 (patch) | |
tree | b2df22a3590d82fccf843a7f7bb730c71dcdf65f /os/kernel/src | |
parent | f569bcec23452c190248aab184a125f3a52e2eb8 (diff) | |
download | ChibiOS-9cd24294b8b5c32af4f64762eb99868b1a5c7b75.tar.gz ChibiOS-9cd24294b8b5c32af4f64762eb99868b1a5c7b75.tar.bz2 ChibiOS-9cd24294b8b5c32af4f64762eb99868b1a5c7b75.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6045 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
-rw-r--r-- | os/kernel/src/chtm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/os/kernel/src/chtm.c b/os/kernel/src/chtm.c index 474177093..2bec0cc1c 100644 --- a/os/kernel/src/chtm.c +++ b/os/kernel/src/chtm.c @@ -56,9 +56,11 @@ static rtcnt_t measurement_offset; /* Module local functions. */
/*===========================================================================*/
-static inline void tm_stop(time_measurement_t *tmp, rtcnt_t now) {
+static inline void tm_stop(time_measurement_t *tmp,
+ rtcnt_t now,
+ rtcnt_t offset) {
- tmp->last = now - tmp->last - measurement_offset;
+ tmp->last = now - tmp->last - offset;
tmp->cumulative += tmp->last;
if (tmp->last > tmp->worst)
tmp->worst = tmp->last;
@@ -126,7 +128,7 @@ NOINLINE void chTMStartMeasurementX(time_measurement_t *tmp) { */
NOINLINE void chTMStopMeasurementX(time_measurement_t *tmp) {
- tm_stop(tmp, chSysGetRealtimeCounterX());
+ tm_stop(tmp, chSysGetRealtimeCounterX(), measurement_offset);
}
#endif /* CH_CFG_USE_TM */
@@ -150,7 +152,7 @@ NOINLINE void chTMChainMeasurementToX(time_measurement_t *tmp1, tmp2->last = chSysGetRealtimeCounterX();
/* Stops previous measurement using the same time stamp.*/
- tm_stop(tmp1, tmp2->last);
+ tm_stop(tmp1, tmp2->last, 0);
}
/** @} */
|