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