The open source OpenXR runtime
0
fork

Configure Feed

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

d/wmr: Tidy

+21 -17
+21 -17
src/xrt/drivers/wmr/wmr_camera.c
··· 179 179 } 180 180 181 181 static int 182 - wmr_camera_send(struct wmr_camera *cam, uint8_t *buf, uint8_t len) 182 + send_buffer_to_device(struct wmr_camera *cam, uint8_t *buf, uint8_t len) 183 183 { 184 184 struct libusb_transfer *xfer; 185 185 uint8_t *data; ··· 203 203 } 204 204 205 205 static int 206 - wmr_camera_set_active(struct wmr_camera *cam, bool active) 206 + set_active(struct wmr_camera *cam, bool active) 207 207 { 208 - struct wmr_camera_active_cmd cmd = {.magic = __cpu_to_le32(WMR_MAGIC), 209 - .len = __cpu_to_le32(sizeof(struct wmr_camera_active_cmd)), 210 - .cmd = __cpu_to_le32(active ? WMR_CAMERA_CMD_ON : WMR_CAMERA_CMD_OFF)}; 208 + struct wmr_camera_active_cmd cmd = { 209 + .magic = __cpu_to_le32(WMR_MAGIC), 210 + .len = __cpu_to_le32(sizeof(struct wmr_camera_active_cmd)), 211 + .cmd = __cpu_to_le32(active ? WMR_CAMERA_CMD_ON : WMR_CAMERA_CMD_OFF), 212 + }; 211 213 212 - return wmr_camera_send(cam, (uint8_t *)&cmd, sizeof(cmd)); 214 + return send_buffer_to_device(cam, (uint8_t *)&cmd, sizeof(cmd)); 213 215 } 214 216 215 217 struct wmr_camera * ··· 376 378 goto fail; 377 379 } 378 380 379 - res = wmr_camera_set_active(cam, false); 381 + res = set_active(cam, false); 380 382 if (res < 0) 381 383 goto fail; 382 384 383 - res = wmr_camera_set_active(cam, true); 385 + res = set_active(cam, true); 384 386 if (res < 0) 385 387 goto fail; 386 388 ··· 432 434 libusb_cancel_transfer(cam->xfers[i]); 433 435 } 434 436 435 - res = wmr_camera_set_active(cam, false); 437 + res = set_active(cam, false); 436 438 if (res < 0) 437 439 goto fail; 438 440 ··· 449 451 int 450 452 wmr_camera_set_gain(struct wmr_camera *cam, uint8_t camera_id, uint8_t gain) 451 453 { 452 - struct wmr_camera_gain_cmd cmd = {.magic = __cpu_to_le32(WMR_MAGIC), 453 - .len = __cpu_to_le32(sizeof(struct wmr_camera_gain_cmd)), 454 - .cmd = __cpu_to_le16(WMR_CAMERA_CMD_GAIN), 455 - .camera_id = __cpu_to_le16(camera_id), 456 - .const_6000 = __cpu_to_le16(6000), 457 - .gain = __cpu_to_le16(gain), 458 - .camera_id2 = __cpu_to_le16(camera_id)}; 454 + struct wmr_camera_gain_cmd cmd = { 455 + .magic = __cpu_to_le32(WMR_MAGIC), 456 + .len = __cpu_to_le32(sizeof(struct wmr_camera_gain_cmd)), 457 + .cmd = __cpu_to_le16(WMR_CAMERA_CMD_GAIN), 458 + .camera_id = __cpu_to_le16(camera_id), 459 + .const_6000 = __cpu_to_le16(6000), 460 + .gain = __cpu_to_le16(gain), 461 + .camera_id2 = __cpu_to_le16(camera_id), 462 + }; 459 463 460 - return wmr_camera_send(cam, (uint8_t *)&cmd, sizeof(cmd)); 464 + return send_buffer_to_device(cam, (uint8_t *)&cmd, sizeof(cmd)); 461 465 }