26#define VIVE_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__)
27#define VIVE_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__)
28#define VIVE_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__)
29#define VIVE_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__)
30#define VIVE_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__)
34#define VIVE_CLOCK_FREQ 48e6
35#define CAMERA_FREQUENCY 54
36#define IMU_FREQUENCY 1000
51 uint32_t sample_ticks = __le32_to_cpu(sample_ticks_raw);
52 uint32_t prev_ticks = *inout_prev_ticks;
57 uint32_t delta_ticks = sample_ticks - prev_ticks;
59 const double one_tick_in_s = (1 / VIVE_CLOCK_FREQ);
63 *inout_prev_ticks = sample_ticks;
64 *inout_ts_ns += delta_ns;
@ U_LOGGING_WARN
Warning messages: indicating a potential problem.
Definition: u_logging.h:48
int64_t timepoint_ns
Integer timestamp type.
Definition: u_time.h:70
int64_t time_duration_ns
Integer duration type in nanoseconds.
Definition: u_time.h:81
Time-keeping: a clock that is steady, convertible to system time, and ideally high-resolution.
#define U_TIME_1S_IN_NS
The number of nanoseconds in a second.
Definition: u_time.h:47
static void ticks_to_ns(uint32_t sample_ticks_raw, uint32_t *inout_prev_ticks, timepoint_ns *inout_ts_ns)
Helper function to convert raw device ticks to nanosecond timestamps.
Definition: vive.h:49
Endian-specific byte order defines.