mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 12:23:23 +08:00
[sys_time] fix get_sys_time_float function
fractional part was wrong
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user