mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 04:36:07 +00:00
t/common: Switch target_builder_legacy to u_system_devices_get_ht_device
This commit is contained in:
parent
a67d2fc28b
commit
6b63d473c6
|
@ -18,35 +18,6 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* 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[] = {
|
static const char *driver_list[] = {
|
||||||
#ifdef XRT_BUILD_DRIVER_HYDRA
|
#ifdef XRT_BUILD_DRIVER_HYDRA
|
||||||
"hydra",
|
"hydra",
|
||||||
|
@ -195,8 +166,10 @@ legacy_open_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find hand tracking devices.
|
// 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.left =
|
||||||
usysd->base.roles.hand_tracking.right = get_ht_device(usysd, XRT_INPUT_GENERIC_HAND_TRACKING_RIGHT);
|
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);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue