8 #ifndef IBEO_CORE_UTILS_H 9 #define IBEO_CORE_UTILS_H 30 uint64_t ntp_sec = tm->tm_year * 31536000;
31 ntp_sec += tm->tm_yday * 86400;
32 ntp_sec += tm->tm_hour * 3600;
33 ntp_sec += tm->tm_min * 60;
34 ntp_sec += tm->tm_sec;
36 ret_val = (ntp_sec << 32);
38 uint64_t ntp_frac = tv->tv_usec;
45 inline double ticks_to_angle(int16_t angle_ticks, uint16_t angle_ticks_per_rotation)
47 return (2.0 * M_PI * static_cast<double>(angle_ticks) / static_cast<double>(angle_ticks_per_rotation));
53 #endif // IBEO_CORE_UTILS_H double ticks_to_angle(int16_t angle_ticks, uint16_t angle_ticks_per_rotation)
NTPTime unix_time_to_ntp(struct tm *tm, struct timeval *tv)