aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-31 10:26:40 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-31 10:26:40 +0000
commit16044c7aeac671a4914749a387a6c526f0b2fdce (patch)
treebaf7912859ac2444e67873aa5113208ff23efe5b /os/kernel/src
parent2c0ef77243a78e374c60b01dae1bd02057d7f12d (diff)
downloadChibiOS-16044c7aeac671a4914749a387a6c526f0b2fdce.tar.gz
ChibiOS-16044c7aeac671a4914749a387a6c526f0b2fdce.tar.bz2
ChibiOS-16044c7aeac671a4914749a387a6c526f0b2fdce.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6053 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
-rw-r--r--os/kernel/src/chtm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/os/kernel/src/chtm.c b/os/kernel/src/chtm.c
index 2bec0cc1c..e54bacbbf 100644
--- a/os/kernel/src/chtm.c
+++ b/os/kernel/src/chtm.c
@@ -60,8 +60,9 @@ static inline void tm_stop(time_measurement_t *tmp,
rtcnt_t now,
rtcnt_t offset) {
+ tmp->n++;
tmp->last = now - tmp->last - offset;
- tmp->cumulative += tmp->last;
+ tmp->cumulative += (rttime_t)tmp->last;
if (tmp->last > tmp->worst)
tmp->worst = tmp->last;
else if (tmp->last < tmp->best)
@@ -101,8 +102,9 @@ void chTMObjectInit(time_measurement_t *tmp) {
tmp->best = (rtcnt_t)-1;
tmp->worst = (rtcnt_t)0;
- tmp->cumulative = (rtcnt_t)0;
tmp->last = (rtcnt_t)0;
+ tmp->n = (ucnt_t)0;
+ tmp->cumulative = (rttime_t)0;
}
/**