aboutsummaryrefslogtreecommitdiff
path: root/src/survive_process.c
diff options
context:
space:
mode:
authorCharles Lohr <lohr85@gmail.com>2016-12-11 00:03:40 -0500
committerCharles Lohr <lohr85@gmail.com>2016-12-11 00:03:40 -0500
commit44d7e56bf6a419104fee5dd2aedc26e00e543d69 (patch)
tree91567a4cfced76249981f616cf22781995989c58 /src/survive_process.c
parent4d5a42768f142c25c2efa6c6fd54e1f0dc484f70 (diff)
downloadlibsurvive-44d7e56bf6a419104fee5dd2aedc26e00e543d69.tar.gz
libsurvive-44d7e56bf6a419104fee5dd2aedc26e00e543d69.tar.bz2
* Get config from headset.
* Make pretty display. * Improve disambiguation.
Diffstat (limited to 'src/survive_process.c')
-rw-r--r--src/survive_process.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/survive_process.c b/src/survive_process.c
index a4680af..139ae2f 100644
--- a/src/survive_process.c
+++ b/src/survive_process.c
@@ -3,16 +3,42 @@
#include "survive_internal.h"
+
+int bufferpts[32*2];
+char buffermts[32*128];
+int buffertimeto[32];
+
void survive_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode )
{
+ if( acode == -1 ) return;
+
+ 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;
+ buffertimeto[sensor_id] = 0;
+ //printf( "X: %d\n",bufferpts[sensor_id*2+0] );
+ //480-(timeinsweep)/1000; // Full scan
+ }
+ 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;
+ //printf( "Y: %d\n",bufferpts[sensor_id*2+1] );
+ buffertimeto[sensor_id] = 0;
+
+ //480-(timeinsweep)/1000; //Full scan
+ }
+
+
//timeinsweep = 200,000 1/48,000,000ths of a second is "center-of-image"
- //printf( "L %s %d %d %d %d\n", so->codename, timecode, sensor_id, acode, timeinsweep );
}
void survive_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id )
{
- if( so->codename[0] != 'H' )
+ //if( so->codename[0] == 'H' )
+ if( 0 )
{
- //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 );
}
}