The open source OpenXR runtime
0
fork

Configure Feed

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

d/ns: Only create a North Star hmd if config path is set

+15 -6
+1 -1
src/xrt/drivers/north_star/ns_hmd.c
··· 192 192 */ 193 193 194 194 struct xrt_device * 195 - ns_hmd_create(bool print_spew, bool print_debug) 195 + ns_hmd_create(const char *config_path, bool print_spew, bool print_debug) 196 196 { 197 197 enum u_device_alloc_flags flags = (enum u_device_alloc_flags)( 198 198 U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE);
+3 -3
src/xrt/drivers/north_star/ns_interface.h
··· 1 - // Copyright 2019, Collabora, Ltd. 1 + // Copyright 2019-2020, Collabora, Ltd. 2 + // Copyright 2020, Nova King. 2 3 // SPDX-License-Identifier: BSL-1.0 3 4 /*! 4 5 * @file ··· 20 21 * @brief Driver for the North Star HMD. 21 22 */ 22 23 23 - 24 24 /*! 25 25 * Create a probe for NS devices. 26 26 * ··· 35 35 * @ingroup drv_ns 36 36 */ 37 37 struct xrt_device * 38 - ns_hmd_create(bool print_spew, bool print_debug); 38 + ns_hmd_create(const char *config_path, bool print_spew, bool print_debug); 39 39 40 40 /*! 41 41 * @dir drivers/north_star
+11 -2
src/xrt/drivers/north_star/ns_prober.c
··· 1 - // Copyright 2019, Collabora, Ltd. 1 + // Copyright 2019-2020, Collabora, Ltd. 2 + // Copyright 2020, Nova King. 2 3 // SPDX-License-Identifier: BSL-1.0 3 4 /*! 4 5 * @file ··· 19 20 #include "ns_interface.h" 20 21 21 22 23 + DEBUG_GET_ONCE_OPTION(ns_config_path, "NS_CONFIG_PATH", NULL) 22 24 DEBUG_GET_ONCE_BOOL_OPTION(ns_spew, "NS_PRINT_SPEW", false) 23 25 DEBUG_GET_ONCE_BOOL_OPTION(ns_debug, "NS_PRINT_DEBUG", false) 24 26 25 27 struct ns_prober 26 28 { 27 29 struct xrt_auto_prober base; 30 + const char *config_path; 28 31 bool print_spew; 29 32 bool print_debug; 30 33 }; ··· 54 57 return NULL; 55 58 } 56 59 57 - return ns_hmd_create(nsp->print_spew, nsp->print_debug); 60 + if (nsp->config_path == NULL) { 61 + return NULL; 62 + } 63 + 64 + return ns_hmd_create(nsp->config_path, nsp->print_spew, 65 + nsp->print_debug); 58 66 } 59 67 60 68 struct xrt_auto_prober * ··· 63 71 struct ns_prober *nsp = U_TYPED_CALLOC(struct ns_prober); 64 72 nsp->base.destroy = ns_prober_destroy; 65 73 nsp->base.lelo_dallas_autoprobe = ns_prober_autoprobe; 74 + nsp->config_path = debug_get_option_ns_config_path(); 66 75 nsp->print_spew = debug_get_bool_option_ns_spew(); 67 76 nsp->print_debug = debug_get_bool_option_ns_debug(); 68 77