Skip to content

Commit

Permalink
[sys_time] fix get_sys_time_float function
Browse files Browse the repository at this point in the history
fractional part was wrong
  • Loading branch information
gautierhattenberger committed Jun 3, 2014
1 parent adc3c87 commit e8cda70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sw/airborne/mcu_periph/sys_time.h
Expand Up @@ -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);
}


Expand Down

0 comments on commit e8cda70

Please sign in to comment.