From e8cda70c921fd0560f75f403b0486f9fab429cdf Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Tue, 3 Jun 2014 15:42:22 +0200 Subject: [PATCH] [sys_time] fix get_sys_time_float function fractional part was wrong --- sw/airborne/mcu_periph/sys_time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/airborne/mcu_periph/sys_time.h b/sw/airborne/mcu_periph/sys_time.h index 407981ddb04..6b137510962 100644 --- a/sw/airborne/mcu_periph/sys_time.h +++ b/sw/airborne/mcu_periph/sys_time.h @@ -121,7 +121,7 @@ static inline bool_t sys_time_check_and_ack_timer(tid_t id) { * @return current system time as float */ static inline float get_sys_time_float(void) { - return (float)(sys_time.nb_sec + sys_time.nb_sec_rem * sys_time.resolution_cpu_ticks); + return (float)(sys_time.nb_sec + (float)(sys_time.nb_sec_rem) / sys_time.cpu_ticks_per_sec); }