The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/vive/device: Use VIVE_WARN and VIVE_INFO.

+24 -24
+22 -24
src/xrt/drivers/vive/vive_device.c
··· 172 172 type = __le16_to_cpu(report.type); 173 173 if (type != VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_TYPE || 174 174 report.len != 60) { 175 - U_LOG_E("Unexpected device info!"); 175 + VIVE_WARN(d, "Unexpected device info!"); 176 176 return -1; 177 177 } 178 178 ··· 181 181 d->firmware.display_firmware_version = 182 182 __le32_to_cpu(report.display_firmware_version); 183 183 184 - VIVE_DEBUG(d, "EDID Manufacturer ID: %c%c%c, Product code: 0x%04x", 185 - '@' + (edid_vid >> 10), '@' + ((edid_vid >> 5) & 0x1f), 186 - '@' + (edid_vid & 0x1f), __le16_to_cpu(report.edid_pid)); 187 - VIVE_DEBUG(d, "Display firmware version: %u", 188 - d->firmware.display_firmware_version); 184 + VIVE_INFO(d, "EDID Manufacturer ID: %c%c%c, Product code: 0x%04x", 185 + '@' + (edid_vid >> 10), '@' + ((edid_vid >> 5) & 0x1f), 186 + '@' + (edid_vid & 0x1f), __le16_to_cpu(report.edid_pid)); 187 + VIVE_INFO(d, "Display firmware version: %u", 188 + d->firmware.display_firmware_version); 189 189 190 190 return 0; 191 191 } ··· 224 224 225 225 if (__le16_to_cpu(report->unknown) != 0x2cd0 || report->len != 60 || 226 226 report->reserved1 || report->reserved2[0]) { 227 - U_LOG_E("Unexpected message content."); 227 + VIVE_WARN(d, "Unexpected message content."); 228 228 } 229 229 230 230 ipd = __le16_to_cpu(report->ipd); ··· 235 235 d->board.ipd = ipd; 236 236 d->board.lens_separation = lens_separation; 237 237 VIVE_TRACE(d, "IPD %4.1f mm. Lens separation %4.1f mm.", 238 - 1e-2 * ipd, 1e-2 * lens_separation); 238 + 1e-2 * ipd, 1e-2 * lens_separation); 239 239 } 240 240 241 241 if (d->board.proximity != proximity) { ··· 347 347 }; 348 348 349 349 VIVE_TRACE(d, "ACC %f %f %f", acceleration.x, acceleration.y, 350 - acceleration.z); 350 + acceleration.z); 351 351 352 352 VIVE_TRACE(d, "GYRO %f %f %f", angular_velocity.x, 353 - angular_velocity.y, angular_velocity.z); 353 + angular_velocity.y, angular_velocity.z); 354 354 355 355 switch (d->variant) { 356 356 case VIVE_VARIANT_VIVE: ··· 433 433 vive_mainboard_decode_message( 434 434 d, (struct vive_mainboard_status_report *)buffer); 435 435 break; 436 - default: 437 - U_LOG_E("Unknown mainboard message type %d", buffer[0]); 438 - break; 436 + default: U_LOG_E("Unknown mainboard message type %d", buffer[0]); break; 439 437 } 440 438 441 439 return true; ··· 596 594 &d->firmware.hardware_version_major); 597 595 598 596 /* 599 - VIVE_DEBUG(d, "Firmware version %u %s@%s FPGA %u.%u", 600 - d->firmware.firmware_version, report.string1, report.string2, 601 - report.fpga_version_major, report.fpga_version_minor); 597 + VIVE_INFO(d, "Firmware version %u %s@%s FPGA %u.%u", 598 + d->firmware.firmware_version, report.string1, report.string2, 599 + report.fpga_version_major, report.fpga_version_minor); 602 600 */ 603 601 604 - VIVE_DEBUG(d, "Firmware version %u", d->firmware.firmware_version); 605 - VIVE_DEBUG(d, "Hardware revision: %d rev %d.%d.%d", 606 - d->firmware.hardware_revision, 607 - d->firmware.hardware_version_major, 608 - d->firmware.hardware_version_minor, 609 - d->firmware.hardware_version_micro); 602 + VIVE_INFO(d, "Firmware version %u", d->firmware.firmware_version); 603 + VIVE_INFO(d, "Hardware revision: %d rev %d.%d.%d", 604 + d->firmware.hardware_revision, 605 + d->firmware.hardware_version_major, 606 + d->firmware.hardware_version_minor, 607 + d->firmware.hardware_version_micro); 610 608 611 609 vive_get_imu_range_report(d->sensors_dev, &d->imu.gyro_range, 612 610 &d->imu.acc_range); 613 - VIVE_DEBUG(d, "Vive gyroscope range %f", d->imu.gyro_range); 614 - VIVE_DEBUG(d, "Vive accelerometer range %f", d->imu.acc_range); 611 + VIVE_INFO(d, "Vive gyroscope range %f", d->imu.gyro_range); 612 + VIVE_INFO(d, "Vive accelerometer range %f", d->imu.acc_range); 615 613 616 614 char *config = vive_read_config(d->sensors_dev); 617 615 if (config != NULL) {
+2
src/xrt/drivers/vive/vive_device.h
··· 150 150 // clang-format off 151 151 #define VIVE_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 152 152 #define VIVE_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 153 + #define VIVE_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 154 + #define VIVE_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 153 155 #define VIVE_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 154 156 // clang-format on 155 157