aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Lohr <lohr85@gmail.com>2016-12-13 02:43:04 -0500
committerCharles Lohr <lohr85@gmail.com>2016-12-13 02:43:04 -0500
commitcebb93ee6b927f277d9f1d33c8b354aa440ebf44 (patch)
tree35b54958136c8c50b3c64a3bbc0c67e9df555e29 /src
parent495ce6aa7b24f93c464ec31fe9efc36d97add845 (diff)
downloadlibsurvive-cebb93ee6b927f277d9f1d33c8b354aa440ebf44.tar.gz
libsurvive-cebb93ee6b927f277d9f1d33c8b354aa440ebf44.tar.bz2
try updating with more data.
Diffstat (limited to 'src')
-rw-r--r--src/survive_process.c27
-rw-r--r--src/survive_usb.c8
2 files changed, 31 insertions, 4 deletions
diff --git a/src/survive_process.c b/src/survive_process.c
index 139ae2f..268fdfc 100644
--- a/src/survive_process.c
+++ b/src/survive_process.c
@@ -15,7 +15,7 @@ void survive_light_process( struct SurviveObject * so, int sensor_id, int acode,
if( acode == 0 || acode == 2 ) //data = 0
{
printf( "L, X, %s, %d, %d, %d, %d\n", so->codename, timecode, sensor_id, acode, timeinsweep );
- bufferpts[sensor_id*2+0] = (timeinsweep-170000)/100;
+ bufferpts[sensor_id*2+0] = (timeinsweep-100000)/500;
buffertimeto[sensor_id] = 0;
//printf( "X: %d\n",bufferpts[sensor_id*2+0] );
//480-(timeinsweep)/1000; // Full scan
@@ -23,7 +23,26 @@ void survive_light_process( struct SurviveObject * so, int sensor_id, int acode,
if( acode == 1 || acode == 3 ) //data = 1
{
printf( "L, Y, %s, %d, %d, %d, %d\n", so->codename, timecode, sensor_id, acode, timeinsweep );
- bufferpts[sensor_id*2+1] = 480-(timeinsweep-140000)/100;
+ bufferpts[sensor_id*2+1] = (timeinsweep-100000)/500;
+ //printf( "Y: %d\n",bufferpts[sensor_id*2+1] );
+ buffertimeto[sensor_id] = 0;
+
+ //480-(timeinsweep)/1000; //Full scan
+ }
+
+
+ if( acode == 4 || acode == 6 ) //data = 0
+ {
+ printf( "R, X, %s, %d, %d, %d, %d\n", so->codename, timecode, sensor_id, acode, timeinsweep );
+ bufferpts[sensor_id*2+0] = (timeinsweep-100000)/500;
+ buffertimeto[sensor_id] = 0;
+ //printf( "X: %d\n",bufferpts[sensor_id*2+0] );
+ //480-(timeinsweep)/1000; // Full scan
+ }
+ if( acode == 5 || acode == 7 ) //data = 1
+ {
+ printf( "R, Y, %s, %d, %d, %d, %d\n", so->codename, timecode, sensor_id, acode, timeinsweep );
+ bufferpts[sensor_id*2+1] = (timeinsweep-100000)/500;
//printf( "Y: %d\n",bufferpts[sensor_id*2+1] );
buffertimeto[sensor_id] = 0;
@@ -37,8 +56,8 @@ void survive_light_process( struct SurviveObject * so, int sensor_id, int acode,
void survive_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id )
{
//if( so->codename[0] == 'H' )
- if( 0 )
+ if( 1 )
{
- printf( "I %s %d %d %d %d %d %d %d %d\n", so->codename, timecode, accelgyro[0], accelgyro[1], accelgyro[2], accelgyro[3], accelgyro[4], accelgyro[5], id );
+ printf( "I, %s, %d, %d, %d, %d, %d, %d, %d, %d\n", so->codename, timecode, accelgyro[0], accelgyro[1], accelgyro[2], accelgyro[3], accelgyro[4], accelgyro[5], id );
}
}
diff --git a/src/survive_usb.c b/src/survive_usb.c
index affcdd5..07e5cb4 100644
--- a/src/survive_usb.c
+++ b/src/survive_usb.c
@@ -247,6 +247,14 @@ int survive_usb_init( struct SurviveContext * ctx )
0x00, 0x18, 0x54, 0x72, 0x00, 0x00, 0x6a, 0x72, 0x00, 0x00, 0x00, 0x00,
};
+ //From actual use. ((THIS SEEMS TO BREAK IT))
+/*
+ static uint8_t vive_magic_power_on[64] = { 0x04, 0x78, 0x29, 0x38,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+*/
r = update_feature_report( ctx->udev[USB_DEV_HMD], 0, vive_magic_power_on, sizeof( vive_magic_power_on ) );
SV_INFO( "UCR: %d", r );
if( r != sizeof( vive_magic_power_on ) ) return 5;