diff options
author | cnlohr <lohr85@gmail.com> | 2018-06-24 13:41:51 -0400 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2018-06-24 13:41:51 -0400 |
commit | 7d5b1db0edf0ec43f13293de1526206721c3494f (patch) | |
tree | 2607ddb1e1389d6bbb471ecec6aa3fc45c74a22b /src/survive_vive.c | |
parent | fe153d9def29387f4ad9712bd364bf8d9fdc5776 (diff) | |
download | libsurvive-7d5b1db0edf0ec43f13293de1526206721c3494f.tar.gz libsurvive-7d5b1db0edf0ec43f13293de1526206721c3494f.tar.bz2 |
Fix base calibration values.
Diffstat (limited to 'src/survive_vive.c')
-rwxr-xr-x | src/survive_vive.c | 14 |
1 files changed, 8 insertions, 6 deletions
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; } |