mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 02:26:16 +00:00
d/*: fix format modifiers for 32 bits
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2272>
This commit is contained in:
parent
39535666a4
commit
967847c742
|
@ -54,7 +54,8 @@ android_sensor_callback(int fd, int events, void *data)
|
||||||
accel.y = -event.acceleration.x;
|
accel.y = -event.acceleration.x;
|
||||||
accel.z = event.acceleration.z;
|
accel.z = event.acceleration.z;
|
||||||
|
|
||||||
ANDROID_TRACE(d, "accel %ld %.2f %.2f %.2f", event.timestamp, accel.x, accel.y, accel.z);
|
ANDROID_TRACE(d, "accel %" PRId64 " %.2f %.2f %.2f", event.timestamp, accel.x, accel.y,
|
||||||
|
accel.z);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ASENSOR_TYPE_GYROSCOPE: {
|
case ASENSOR_TYPE_GYROSCOPE: {
|
||||||
|
@ -62,7 +63,7 @@ android_sensor_callback(int fd, int events, void *data)
|
||||||
gyro.y = event.data[0];
|
gyro.y = event.data[0];
|
||||||
gyro.z = event.data[2];
|
gyro.z = event.data[2];
|
||||||
|
|
||||||
ANDROID_TRACE(d, "gyro %ld %.2f %.2f %.2f", event.timestamp, gyro.x, gyro.y, gyro.z);
|
ANDROID_TRACE(d, "gyro %" PRId64 " %.2f %.2f %.2f", event.timestamp, gyro.x, gyro.y, gyro.z);
|
||||||
|
|
||||||
// TODO: Make filter handle accelerometer
|
// TODO: Make filter handle accelerometer
|
||||||
struct xrt_vec3 null_accel;
|
struct xrt_vec3 null_accel;
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
#define QWERTY_HMD_INITIAL_MOVEMENT_SPEED 0.002f // in meters per frame
|
#define QWERTY_HMD_INITIAL_MOVEMENT_SPEED 0.002f // in meters per frame
|
||||||
#define QWERTY_HMD_INITIAL_LOOK_SPEED 0.02f // in radians per frame
|
#define QWERTY_HMD_INITIAL_LOOK_SPEED 0.02f // in radians per frame
|
||||||
#define QWERTY_CONTROLLER_INITIAL_MOVEMENT_SPEED 0.005f
|
#define QWERTY_CONTROLLER_INITIAL_MOVEMENT_SPEED 0.005f
|
||||||
|
@ -132,7 +131,7 @@ qwerty_set_output(struct xrt_device *xd, enum xrt_output_name name, const union
|
||||||
if (amplitude || duration || frequency) {
|
if (amplitude || duration || frequency) {
|
||||||
QWERTY_INFO(qd,
|
QWERTY_INFO(qd,
|
||||||
"[%s] Haptic output: \n"
|
"[%s] Haptic output: \n"
|
||||||
"\tfrequency=%.2f amplitude=%.2f duration=%ld",
|
"\tfrequency=%.2f amplitude=%.2f duration=%" PRId64,
|
||||||
xd->str, frequency, amplitude, duration);
|
xd->str, frequency, amplitude, duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,7 +353,7 @@ ControllerDevice::set_haptic_handle(vr::VRInputComponentHandle_t handle)
|
||||||
{
|
{
|
||||||
// this should only be set once
|
// this should only be set once
|
||||||
assert(output == nullptr);
|
assert(output == nullptr);
|
||||||
DEV_DEBUG("setting haptic handle for %lu", handle);
|
DEV_DEBUG("setting haptic handle for %" PRIu64, handle);
|
||||||
haptic_handle = handle;
|
haptic_handle = handle;
|
||||||
xrt_output_name name;
|
xrt_output_name name;
|
||||||
switch (this->name) {
|
switch (this->name) {
|
||||||
|
|
|
@ -570,11 +570,10 @@ Context::UpdateScalarComponent(vr::VRInputComponentHandle_t ulComponent, float f
|
||||||
} else if (components->y == ulComponent) {
|
} else if (components->y == ulComponent) {
|
||||||
input->value.vec2.y = fNewValue;
|
input->value.vec2.y = fNewValue;
|
||||||
} else {
|
} else {
|
||||||
CTX_WARN(
|
CTX_WARN("Attempted to update component with handle %" PRIu64
|
||||||
"Attempted to update component with handle %lu"
|
" but it was neither the x nor y "
|
||||||
" but it was neither the x nor y "
|
"component of its associated input",
|
||||||
"component of its associated input",
|
ulComponent);
|
||||||
ulComponent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -592,7 +591,7 @@ Context::UpdateScalarComponent(vr::VRInputComponentHandle_t ulComponent, float f
|
||||||
finger_input->second->timestamp = timestamp;
|
finger_input->second->timestamp = timestamp;
|
||||||
finger_input->second->value = fNewValue;
|
finger_input->second->value = fNewValue;
|
||||||
} else {
|
} else {
|
||||||
CTX_WARN("Unmapped component %lu", ulComponent);
|
CTX_WARN("Unmapped component %" PRIu64, ulComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -731,7 +731,7 @@ vive_controller_decode_watchmanv1(struct vive_controller_device *d, struct vive_
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf > end)
|
if (buf > end)
|
||||||
VIVE_ERROR(d, "overshoot: %ld\n", buf - end);
|
VIVE_ERROR(d, "overshoot: %td\n", (ptrdiff_t)(buf - end));
|
||||||
|
|
||||||
if (buf < end)
|
if (buf < end)
|
||||||
vive_controller_handle_lighthousev1(d, buf, end - buf);
|
vive_controller_handle_lighthousev1(d, buf, end - buf);
|
||||||
|
@ -899,10 +899,11 @@ vive_controller_decode_watchmanv2(struct vive_controller_device *d, struct vive_
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (buf < end) {
|
if (buf < end) {
|
||||||
VIVE_TRACE(d, "%ld bytes unparsed data in message\n", message->len - (buf - message->payload) - 1);
|
VIVE_TRACE(d, "%td bytes unparsed data in message\n",
|
||||||
|
(ptrdiff_t)(message->len - (buf - message->payload) - 1));
|
||||||
}
|
}
|
||||||
if (buf > end)
|
if (buf > end)
|
||||||
VIVE_ERROR(d, "overshoot: %ld\n", buf - end);
|
VIVE_ERROR(d, "overshoot: %td\n", (ptrdiff_t)(buf - end));
|
||||||
|
|
||||||
//! @todo: Parse lighthouse v2 data
|
//! @todo: Parse lighthouse v2 data
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,11 +130,11 @@ vive_source_receive_sbs_frame(struct xrt_frame_sink *sink, struct xrt_frame *xf)
|
||||||
bool should_push = vive_source_try_convert_v4l2_timestamp(vs, xf);
|
bool should_push = vive_source_try_convert_v4l2_timestamp(vs, xf);
|
||||||
|
|
||||||
if (!should_push) {
|
if (!should_push) {
|
||||||
VIVE_TRACE(vs, "skipped sbs img t=%ld source_t=%ld", xf->timestamp, xf->source_timestamp);
|
VIVE_TRACE(vs, "skipped sbs img t=%" PRId64 " source_t=%" PRId64, xf->timestamp, xf->source_timestamp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIVE_TRACE(vs, "sbs img t=%ld source_t=%ld", xf->timestamp, xf->source_timestamp);
|
VIVE_TRACE(vs, "sbs img t=%" PRId64 " source_t=%" PRId64, xf->timestamp, xf->source_timestamp);
|
||||||
|
|
||||||
if (vs->out_sinks.cams[0]) { // The split into left right will happen downstream
|
if (vs->out_sinks.cams[0]) { // The split into left right will happen downstream
|
||||||
xrt_sink_push_frame(vs->out_sinks.cams[0], xf);
|
xrt_sink_push_frame(vs->out_sinks.cams[0], xf);
|
||||||
|
@ -149,7 +149,7 @@ vive_source_receive_imu_sample(struct xrt_imu_sink *sink, struct xrt_imu_sample
|
||||||
timepoint_ns ts = s->timestamp_ns;
|
timepoint_ns ts = s->timestamp_ns;
|
||||||
struct xrt_vec3_f64 a = s->accel_m_s2;
|
struct xrt_vec3_f64 a = s->accel_m_s2;
|
||||||
struct xrt_vec3_f64 w = s->gyro_rad_secs;
|
struct xrt_vec3_f64 w = s->gyro_rad_secs;
|
||||||
VIVE_TRACE(vs, "imu t=%ld a=(%f %f %f) w=(%f %f %f)", ts, a.x, a.y, a.z, w.x, w.y, w.z);
|
VIVE_TRACE(vs, "imu t=%" PRId64 " a=(%f %f %f) w=(%f %f %f)", ts, a.x, a.y, a.z, w.x, w.y, w.z);
|
||||||
|
|
||||||
if (vs->out_sinks.imu) {
|
if (vs->out_sinks.imu) {
|
||||||
xrt_sink_push_imu(vs->out_sinks.imu, s);
|
xrt_sink_push_imu(vs->out_sinks.imu, s);
|
||||||
|
|
|
@ -558,7 +558,7 @@ handle_sensor_msg(struct xreal_air_hmd *hmd, unsigned char *buffer, int size)
|
||||||
// If this is larger then one second something bad is going on.
|
// If this is larger then one second something bad is going on.
|
||||||
if (hmd->fusion.state != M_IMU_3DOF_STATE_START &&
|
if (hmd->fusion.state != M_IMU_3DOF_STATE_START &&
|
||||||
inter_sample_duration_ns >= (time_duration_ns)U_TIME_1S_IN_NS) {
|
inter_sample_duration_ns >= (time_duration_ns)U_TIME_1S_IN_NS) {
|
||||||
XREAL_AIR_ERROR(hmd, "Drop packet (sensor too slow): %lu", inter_sample_duration_ns);
|
XREAL_AIR_ERROR(hmd, "Drop packet (sensor too slow): %" PRId64, inter_sample_duration_ns);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue