From 86bbd12c3889db3290e22ff61934ca1a218ce114 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Fri, 27 Apr 2018 21:42:05 -0400 Subject: New config system --- src/survive_vive.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/survive_vive.c') diff --git a/src/survive_vive.c b/src/survive_vive.c index 493215a..37bec7e 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -40,6 +40,7 @@ #endif #endif + struct SurviveViveData; const short vidpids[] = { -- cgit v1.2.3 From e8b268f4c0116b135400ef6cf3dc939481de119b Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sat, 23 Jun 2018 14:27:27 -0400 Subject: Fix units for vive, but not switching scales to incremental. --- src/survive_vive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/survive_vive.c') diff --git a/src/survive_vive.c b/src/survive_vive.c index 37bec7e..b20052d 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -553,7 +553,7 @@ int survive_vive_send_magic(SurviveContext * ctx, void * drv, int magic_code, vo //From actual steam. if (sv->udev[USB_DEV_HMD]) { - static uint8_t vive_magic_power_on[64] = { 0x04, 0x78, 0x29, 0x38 }; + static uint8_t vive_magic_power_on[64] = { 0x04, 0x78, 0x29, 0x38, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01 }; r = update_feature_report( sv->udev[USB_DEV_HMD], 0, vive_magic_power_on, sizeof( vive_magic_power_on ) ); if( r != sizeof( vive_magic_power_on ) ) return 5; } -- cgit v1.2.3 From 7d5b1db0edf0ec43f13293de1526206721c3494f Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 24 Jun 2018 13:41:51 -0400 Subject: Fix base calibration values. --- src/survive_vive.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/survive_vive.c') diff --git a/src/survive_vive.c b/src/survive_vive.c index b20052d..a83c6a1 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -491,6 +491,7 @@ int survive_usb_init( SurviveViveData * sv, SurviveObject * hmd, SurviveObject * SV_ERROR( "Could not claim interface %d of %s", j, devnames[i] ); return -9; } + usleep(20000); } SV_INFO( "Successfully enumerated %s (%d, %d)", devnames[i], did, conf->bNumInterfaces ); @@ -894,12 +895,6 @@ int survive_get_config( char ** config, SurviveViveData * sv, int devno, int ifa } SV_INFO( "Got config data length %d", count ); - - char fstname[128]; - sprintf( fstname, "calinfo/%d.json.gz", devno ); - FILE * f = fopen( fstname, "wb" ); - fwrite( compressed_data, count, 1, f ); - fclose( f ); int len = survive_simple_inflate( ctx, compressed_data, count, uncompressed_data, sizeof(uncompressed_data)-1 ); if( len <= 0 ) @@ -910,6 +905,13 @@ int survive_get_config( char ** config, SurviveViveData * sv, int devno, int ifa *config = malloc( len + 1 ); memcpy( *config, uncompressed_data, len ); + + char fstname[128]; + sprintf( fstname, "calinfo/%d.json", devno ); + FILE * f = fopen( fstname, "wb" ); + fwrite( uncompressed_data, len, 1, f ); + fclose( f ); + return len; } -- cgit v1.2.3 From 8ae8f5aa50ef7472a486ec6f3688e7dfb0c9dcab Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 24 Jun 2018 20:23:34 -0400 Subject: Refactor --- src/survive_vive.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/survive_vive.c') diff --git a/src/survive_vive.c b/src/survive_vive.c index a83c6a1..0c8f583 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -491,10 +491,11 @@ int survive_usb_init( SurviveViveData * sv, SurviveObject * hmd, SurviveObject * SV_ERROR( "Could not claim interface %d of %s", j, devnames[i] ); return -9; } - usleep(20000); } SV_INFO( "Successfully enumerated %s (%d, %d)", devnames[i], did, conf->bNumInterfaces ); + + usleep(100000); } libusb_free_device_list( devs, 1 ); -- cgit v1.2.3 From fc9bdfa45e8ad1e4eeefc272db077a25af542a82 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 25 Jun 2018 00:56:58 -0400 Subject: Add blacklisting of devices, as well as improve feedback algorithm for charlesrefine. --- src/survive_vive.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/survive_vive.c') diff --git a/src/survive_vive.c b/src/survive_vive.c index 0c8f583..07bda58 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -501,12 +501,14 @@ int survive_usb_init( SurviveViveData * sv, SurviveObject * hmd, SurviveObject * libusb_free_device_list( devs, 1 ); #endif + const char * blacklist = survive_configs(ctx, "blacklist-devs", SC_GET, "-"); + //Add the drivers - this must happen BEFORE we actually attach interfaces. - if( sv->udev[USB_DEV_HMD_IMU_LH] ) { survive_add_object( ctx, hmd ); } - if( sv->udev[USB_DEV_WATCHMAN1] ) { survive_add_object( ctx, wm0 ); } - if( sv->udev[USB_DEV_WATCHMAN2] ) { survive_add_object( ctx, wm1 ); } - if( sv->udev[USB_DEV_TRACKER0] ) { survive_add_object( ctx, tr0 ); } - if( sv->udev[USB_DEV_W_WATCHMAN1] ) { survive_add_object( ctx, ww0 ); } + if( !strstr( blacklist, "HMD" ) && sv->udev[USB_DEV_HMD_IMU_LH] ) { survive_add_object( ctx, hmd ); } + if( !strstr( blacklist, "WM0" ) && sv->udev[USB_DEV_WATCHMAN1] ) { survive_add_object( ctx, wm0 ); } + if( !strstr( blacklist, "WM1" ) && sv->udev[USB_DEV_WATCHMAN2] ) { survive_add_object( ctx, wm1 ); } + if( !strstr( blacklist, "TR0" ) && sv->udev[USB_DEV_TRACKER0] ) { survive_add_object( ctx, tr0 ); } + if( !strstr( blacklist, "WW0" ) && sv->udev[USB_DEV_W_WATCHMAN1] ) { survive_add_object( ctx, ww0 ); } if( sv->udev[USB_DEV_HMD] && AttachInterface( sv, hmd, USB_IF_HMD, sv->udev[USB_DEV_HMD], 0x81, survive_data_cb, "Mainboard" ) ) { return -6; } if( sv->udev[USB_DEV_HMD_IMU_LH] && AttachInterface( sv, hmd, USB_IF_HMD_IMU_LH, sv->udev[USB_DEV_HMD_IMU_LH], 0x81, survive_data_cb, "Lighthouse" ) ) { return -7; } -- cgit v1.2.3