From 890a3addcc936229541626e6748fadd142f58a6e Mon Sep 17 00:00:00 2001 From: cnlohr Date: Thu, 15 Dec 2016 22:35:51 -0500 Subject: rework some of the way we display data and the way magic codes are sent. --- src/survive_process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/survive_process.c') diff --git a/src/survive_process.c b/src/survive_process.c index 268fdfc..046971f 100644 --- a/src/survive_process.c +++ b/src/survive_process.c @@ -8,13 +8,13 @@ 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 ) +void survive_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length ) { 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 ); + printf( "L X %s %d %d %d %d %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); bufferpts[sensor_id*2+0] = (timeinsweep-100000)/500; buffertimeto[sensor_id] = 0; //printf( "X: %d\n",bufferpts[sensor_id*2+0] ); @@ -22,7 +22,7 @@ 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 ); + printf( "L Y %s %d %d %d %d %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); bufferpts[sensor_id*2+1] = (timeinsweep-100000)/500; //printf( "Y: %d\n",bufferpts[sensor_id*2+1] ); buffertimeto[sensor_id] = 0; @@ -33,7 +33,7 @@ void survive_light_process( struct SurviveObject * so, int sensor_id, int acode, if( acode == 4 || acode == 6 ) //data = 0 { - printf( "R, X, %s, %d, %d, %d, %d\n", so->codename, timecode, sensor_id, acode, timeinsweep ); + printf( "R X %s %d %d %d %d %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); bufferpts[sensor_id*2+0] = (timeinsweep-100000)/500; buffertimeto[sensor_id] = 0; //printf( "X: %d\n",bufferpts[sensor_id*2+0] ); @@ -41,7 +41,7 @@ void survive_light_process( struct SurviveObject * so, int sensor_id, int acode, } if( acode == 5 || acode == 7 ) //data = 1 { - printf( "R, Y, %s, %d, %d, %d, %d\n", so->codename, timecode, sensor_id, acode, timeinsweep ); + printf( "R Y %s %d %d %d %d %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); bufferpts[sensor_id*2+1] = (timeinsweep-100000)/500; //printf( "Y: %d\n",bufferpts[sensor_id*2+1] ); buffertimeto[sensor_id] = 0; @@ -58,6 +58,6 @@ void survive_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32 //if( so->codename[0] == 'H' ) 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 ); } } -- cgit v1.2.3 From 898a9a5f242a1691e1c34062208b48cb0682b5d9 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Fri, 16 Dec 2016 00:41:28 -0500 Subject: Remove dependency on Xinerama Improve camfinder a little Add data_recorder.c Closes #1 making libsurvive much more pluggable. --- src/survive_process.c | 54 ++++++--------------------------------------------- 1 file changed, 6 insertions(+), 48 deletions(-) (limited to 'src/survive_process.c') diff --git a/src/survive_process.c b/src/survive_process.c index 046971f..d3a8c4a 100644 --- a/src/survive_process.c +++ b/src/survive_process.c @@ -8,56 +8,14 @@ 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, uint32_t length ) +void survive_default_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length ) { - if( acode == -1 ) return; - - if( acode == 0 || acode == 2 ) //data = 0 - { - printf( "L X %s %d %d %d %d %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); - 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 == 1 || acode == 3 ) //data = 1 - { - printf( "L Y %s %d %d %d %d %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); - 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 %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); - 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 %d\n", so->codename, timecode, sensor_id, acode, timeinsweep, length ); - 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 - } - - - //timeinsweep = 200,000 1/48,000,000ths of a second is "center-of-image" + //TODO: Writeme! } -void survive_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id ) +void survive_default_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id ) { - //if( so->codename[0] == 'H' ) - 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 ); - } + //TODO: Writeme! } + + -- cgit v1.2.3