From 6b63d473c6564c5a34f60f77b8c39e21c491a5ae Mon Sep 17 00:00:00 2001 From: Moses Turner Date: Wed, 22 Jun 2022 16:32:59 +0100 Subject: [PATCH] t/common: Switch target_builder_legacy to u_system_devices_get_ht_device --- .../targets/common/target_builder_legacy.c | 35 +++---------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/src/xrt/targets/common/target_builder_legacy.c b/src/xrt/targets/common/target_builder_legacy.c index 16075667b..a6e142caf 100644 --- a/src/xrt/targets/common/target_builder_legacy.c +++ b/src/xrt/targets/common/target_builder_legacy.c @@ -18,35 +18,6 @@ #include - -/* - * - * Helper functions. - * - */ - -static struct xrt_device * -get_ht_device(struct u_system_devices *usysd, enum xrt_input_name name) -{ - for (uint32_t i = 0; i < usysd->base.xdev_count; i++) { - struct xrt_device *xdev = usysd->base.xdevs[i]; - - if (xdev == NULL || !xdev->hand_tracking_supported) { - continue; - } - - for (uint32_t j = 0; j < xdev->input_count; j++) { - struct xrt_input *input = &xdev->inputs[j]; - - if (input->name == name) { - return xdev; - } - } - } - - return NULL; -} - static const char *driver_list[] = { #ifdef XRT_BUILD_DRIVER_HYDRA "hydra", @@ -195,8 +166,10 @@ legacy_open_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, } // Find hand tracking devices. - usysd->base.roles.hand_tracking.left = get_ht_device(usysd, XRT_INPUT_GENERIC_HAND_TRACKING_LEFT); - usysd->base.roles.hand_tracking.right = get_ht_device(usysd, XRT_INPUT_GENERIC_HAND_TRACKING_RIGHT); + usysd->base.roles.hand_tracking.left = + u_system_devices_get_ht_device(usysd, XRT_INPUT_GENERIC_HAND_TRACKING_LEFT); + usysd->base.roles.hand_tracking.right = + u_system_devices_get_ht_device(usysd, XRT_INPUT_GENERIC_HAND_TRACKING_RIGHT); /*