mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
drivers: Migrate num_ to _count
This commit is contained in:
parent
4957f6577f
commit
2e323add6f
|
@ -167,14 +167,14 @@ _get_lighthouse(struct vive_config *d, const cJSON *json)
|
|||
map = NULL;
|
||||
|
||||
d->lh.sensors = s;
|
||||
d->lh.num_sensors = map_size;
|
||||
d->lh.sensor_count = map_size;
|
||||
|
||||
|
||||
// Transform the sensors into IMU space.
|
||||
struct xrt_pose trackref_to_imu = XRT_POSE_IDENTITY;
|
||||
math_pose_invert(&d->imu.trackref, &trackref_to_imu);
|
||||
|
||||
for (i = 0; i < d->lh.num_sensors; i++) {
|
||||
for (i = 0; i < d->lh.sensor_count; i++) {
|
||||
struct xrt_vec3 point = d->lh.sensors[i].pos;
|
||||
struct xrt_vec3 normal = d->lh.sensors[i].normal;
|
||||
|
||||
|
@ -527,7 +527,7 @@ vive_config_teardown(struct vive_config *config)
|
|||
if (config->lh.sensors != NULL) {
|
||||
free(config->lh.sensors);
|
||||
config->lh.sensors = NULL;
|
||||
config->lh.num_sensors = 0;
|
||||
config->lh.sensor_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ struct lh_sensor
|
|||
struct lh_model
|
||||
{
|
||||
struct lh_sensor *sensors;
|
||||
size_t num_sensors;
|
||||
size_t sensor_count;
|
||||
};
|
||||
|
||||
struct vive_config
|
||||
|
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
int
|
||||
hdk_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev);
|
||||
|
|
|
@ -28,7 +28,7 @@ static const char HDK12_PRODUCT_STRING[] = "OSVR HDK 1.2";
|
|||
int
|
||||
hdk_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev)
|
||||
|
|
|
@ -570,7 +570,7 @@ hydra_device_destroy(struct xrt_device *xdev)
|
|||
int
|
||||
hydra_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdevs)
|
||||
|
|
|
@ -33,7 +33,7 @@ extern "C" {
|
|||
int
|
||||
hydra_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdevs);
|
||||
|
|
|
@ -1154,10 +1154,10 @@ oh_device_create(ohmd_context *ctx, bool no_hmds, struct xrt_device **out_xdevs)
|
|||
}
|
||||
|
||||
/* Probe for devices */
|
||||
int num_devices = ohmd_ctx_probe(ctx);
|
||||
int device_count = ohmd_ctx_probe(ctx);
|
||||
|
||||
/* Then loop */
|
||||
for (int i = 0; i < num_devices; i++) {
|
||||
for (int i = 0; i < device_count; i++) {
|
||||
int device_class = 0, device_flags = 0;
|
||||
const char *prod = NULL;
|
||||
|
||||
|
|
|
@ -995,7 +995,7 @@ static struct xrt_binding_profile binding_profiles[1] = {
|
|||
int
|
||||
psmv_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdevs)
|
||||
|
|
|
@ -33,7 +33,7 @@ extern "C" {
|
|||
int
|
||||
psmv_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdevs);
|
||||
|
|
|
@ -380,7 +380,7 @@ ulv2_device_destroy(struct xrt_device *xdev)
|
|||
int
|
||||
ulv2_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev)
|
||||
|
|
|
@ -25,7 +25,7 @@ extern "C" {
|
|||
int
|
||||
ulv2_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev);
|
||||
|
|
|
@ -63,7 +63,7 @@ static int
|
|||
init_vive1(struct xrt_prober *xp,
|
||||
struct xrt_prober_device *dev,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
enum u_logging_level ll,
|
||||
struct xrt_device **out_xdev)
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ init_vive1(struct xrt_prober *xp,
|
|||
struct os_hid_device *sensors_dev = NULL;
|
||||
struct os_hid_device *watchman_dev = NULL;
|
||||
|
||||
for (uint32_t i = 0; i < num_devices; i++) {
|
||||
for (uint32_t i = 0; i < device_count; i++) {
|
||||
struct xrt_prober_device *d = devices[i];
|
||||
|
||||
if (d->vendor_id != VALVE_VID && d->product_id != VIVE_LIGHTHOUSE_FPGA_RX)
|
||||
|
@ -134,7 +134,7 @@ static int
|
|||
init_vive_pro(struct xrt_prober *xp,
|
||||
struct xrt_prober_device *dev,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
enum u_logging_level ll,
|
||||
struct xrt_device **out_xdev)
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ init_vive_pro(struct xrt_prober *xp,
|
|||
struct os_hid_device *sensors_dev = NULL;
|
||||
struct os_hid_device *watchman_dev = NULL;
|
||||
|
||||
for (uint32_t i = 0; i < num_devices; i++) {
|
||||
for (uint32_t i = 0; i < device_count; i++) {
|
||||
struct xrt_prober_device *d = devices[i];
|
||||
|
||||
if (d->vendor_id != VALVE_VID && d->product_id != VIVE_PRO_LHR_PID)
|
||||
|
@ -208,7 +208,7 @@ static int
|
|||
init_valve_index(struct xrt_prober *xp,
|
||||
struct xrt_prober_device *dev,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
enum u_logging_level ll,
|
||||
struct xrt_device **out_xdevs)
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ init_valve_index(struct xrt_prober *xp,
|
|||
int
|
||||
vive_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev)
|
||||
|
@ -302,9 +302,9 @@ vive_found(struct xrt_prober *xp,
|
|||
}
|
||||
|
||||
switch (dev->product_id) {
|
||||
case VIVE_PID: return init_vive1(xp, dev, devices, num_devices, ll, out_xdev);
|
||||
case VIVE_PRO_MAINBOARD_PID: return init_vive_pro(xp, dev, devices, num_devices, ll, out_xdev);
|
||||
case VIVE_PRO_LHR_PID: return init_valve_index(xp, dev, devices, num_devices, ll, out_xdev);
|
||||
case VIVE_PID: return init_vive1(xp, dev, devices, device_count, ll, out_xdev);
|
||||
case VIVE_PRO_MAINBOARD_PID: return init_vive_pro(xp, dev, devices, device_count, ll, out_xdev);
|
||||
case VIVE_PRO_LHR_PID: return init_valve_index(xp, dev, devices, device_count, ll, out_xdev);
|
||||
default: U_LOG_E("No product ids matched %.4x", dev->product_id); return -1;
|
||||
}
|
||||
|
||||
|
@ -314,7 +314,7 @@ vive_found(struct xrt_prober *xp,
|
|||
int
|
||||
vive_controller_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdevs)
|
||||
|
|
|
@ -47,7 +47,7 @@ extern "C" {
|
|||
int
|
||||
vive_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev);
|
||||
|
@ -61,7 +61,7 @@ vive_found(struct xrt_prober *xp,
|
|||
int
|
||||
vive_controller_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdevs);
|
||||
|
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
int
|
||||
wmr_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev);
|
||||
|
|
|
@ -72,7 +72,7 @@ check_and_get_interface_lenovo(struct xrt_prober_device *device,
|
|||
static bool
|
||||
find_control_device(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
enum u_logging_level ll,
|
||||
enum wmr_headset_type *out_hmd_type,
|
||||
struct xrt_prober_device **out_device,
|
||||
|
@ -81,7 +81,7 @@ find_control_device(struct xrt_prober *xp,
|
|||
struct xrt_prober_device *dev = NULL;
|
||||
int interface = 0;
|
||||
|
||||
for (size_t i = 0; i < num_devices; i++) {
|
||||
for (size_t i = 0; i < device_count; i++) {
|
||||
bool match = false;
|
||||
|
||||
if (devices[i]->bus != XRT_BUS_TYPE_USB) {
|
||||
|
@ -131,7 +131,7 @@ find_control_device(struct xrt_prober *xp,
|
|||
int
|
||||
wmr_found(struct xrt_prober *xp,
|
||||
struct xrt_prober_device **devices,
|
||||
size_t num_devices,
|
||||
size_t device_count,
|
||||
size_t index,
|
||||
cJSON *attached_data,
|
||||
struct xrt_device **out_xdev)
|
||||
|
@ -153,7 +153,7 @@ wmr_found(struct xrt_prober *xp,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!find_control_device(xp, devices, num_devices, ll, &hmd_type, &dev_ctrl, &interface_ctrl)) {
|
||||
if (!find_control_device(xp, devices, device_count, ll, &hmd_type, &dev_ctrl, &interface_ctrl)) {
|
||||
U_LOG_IFL_E(ll,
|
||||
"Did not find companion control device."
|
||||
"\n\tCurrently only Reverb G1 and G2 is supported");
|
||||
|
|
Loading…
Reference in a new issue