From cb3096128a3dd892bb9c6dd08b85375485814892 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 28 Apr 2020 15:21:09 -0500 Subject: [PATCH] d/vive: Fix build on Android NDK by switching byte order utilities. --- src/xrt/drivers/vive/vive_controller_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xrt/drivers/vive/vive_controller_driver.c b/src/xrt/drivers/vive/vive_controller_driver.c index 598b88df4..93dd788bf 100644 --- a/src/xrt/drivers/vive/vive_controller_driver.c +++ b/src/xrt/drivers/vive/vive_controller_driver.c @@ -553,8 +553,8 @@ controller_handle_buttons(struct vive_controller_device *d, uint8_t buttons) static void controller_handle_touch_position(struct vive_controller_device *d, uint8_t *buf) { - int16_t x = __le16_to_cpup((__le16 *)buf); - int16_t y = __le16_to_cpup((__le16 *)(buf + 2)); + int16_t x = __le16_to_cpu(*(__le16 *)buf); + int16_t y = __le16_to_cpu(*(__le16 *)(buf + 2)); d->state.trackpad.x = (float)x / INT16_MAX; d->state.trackpad.y = (float)y / INT16_MAX; if (d->state.trackpad.x != 0 || d->state.trackpad.y != 0)