From a90c37bddb39572687d12d75e3ce5a5e8ecd6a71 Mon Sep 17 00:00:00 2001 From: Simon Brandner Date: Tue, 18 Dec 2012 10:47:48 +0100 Subject: fix overflow after ~35 minutes in dlt_uptime function. Should now ocurr after >100 hrs Signed-off-by: Alexander Wenzel --- src/shared/dlt_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index b2324b1..3e7e498 100755 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -3077,8 +3077,8 @@ uint32_t dlt_uptime(void) struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC,&ts)==0) - { - return (uint32_t)((((ts.tv_sec*1000000)+(ts.tv_nsec/1000)))/100); // in 0.1 ms = 100 us + { + return ( (uint32_t)ts.tv_sec*10000 + (uint32_t)ts.tv_nsec/100000 );// in 0.1 ms = 100 us } else { -- cgit v1.2.1