aboutsummaryrefslogtreecommitdiff
path: root/calibrate.c
diff options
context:
space:
mode:
authorMichael Turvey <mwturvey@users.noreply.github.com>2017-03-25 21:57:41 -0700
committerGitHub <noreply@github.com>2017-03-25 21:57:41 -0700
commitb795afd28b7f7e2c1b9ca3f01e9f5ffeb1c75be8 (patch)
treed7156b4742fa6a77c71c9deb46237c9b8ef1a670 /calibrate.c
parent5404526ae8da8c5fdff81b8ee8120ffe73647747 (diff)
parentefe1b3e98866d45dd3bb5f8060712db152762edd (diff)
downloadlibsurvive-b795afd28b7f7e2c1b9ca3f01e9f5ffeb1c75be8.tar.gz
libsurvive-b795afd28b7f7e2c1b9ca3f01e9f5ffeb1c75be8.tar.bz2
Merge pull request #43 from mwturvey/alternate_disambiguator
Alternate disambiguator
Diffstat (limited to 'calibrate.c')
-rw-r--r--calibrate.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/calibrate.c b/calibrate.c
index f27131a..abf592a 100644
--- a/calibrate.c
+++ b/calibrate.c
@@ -51,36 +51,36 @@ int bufferpts[32*2*3][2];
char buffermts[32*128*3];
int buffertimeto[32*3][2];
-void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length )
+void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length, uint32_t lh)
{
// if( timeinsweep < 0 ) return;
- survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length );
+ survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length, lh);
if( sensor_id < 0 ) return;
if( acode < 0 ) return;
//return;
int jumpoffset = sensor_id;
- if( strcmp( so->codename, "WM0" ) == 0 ) jumpoffset += 32;
+ if( strcmp( so->codename, "WM0" ) == 0 || strcmp( so->codename, "WW0" ) == 0) jumpoffset += 32;
else if( strcmp( so->codename, "WM1" ) == 0 ) jumpoffset += 64;
- if( acode == 0 || acode == 2 ) //data = 0
+ if( acode % 2 == 0 && lh == 0) //data = 0
{
bufferpts[jumpoffset*2+0][0] = (timeinsweep-100000)/500;
buffertimeto[jumpoffset][0] = 0;
}
- if( acode == 1 || acode == 3 ) //data = 1
+ if( acode % 2 == 1 && lh == 0 ) //data = 1
{
bufferpts[jumpoffset*2+1][0] = (timeinsweep-100000)/500;
buffertimeto[jumpoffset][0] = 0;
}
- if( acode == 4 || acode == 6 ) //data = 0
+ if( acode % 2 == 0 && lh == 1 ) //data = 0
{
bufferpts[jumpoffset*2+0][1] = (timeinsweep-100000)/500;
buffertimeto[jumpoffset][1] = 0;
}
- if( acode == 5 || acode == 7 ) //data = 1
+ if( acode % 2 == 1 && lh == 1 ) //data = 1
{
bufferpts[jumpoffset*2+1][1] = (timeinsweep-100000)/500;
buffertimeto[jumpoffset][1] = 0;
@@ -99,9 +99,9 @@ void my_imu_process( struct SurviveObject * so, int mask, FLT * accelgyro, uint3
}
-void my_angle_process( struct SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle )
+void my_angle_process( struct SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle, uint32_t lh)
{
- survive_default_angle_process( so, sensor_id, acode, timecode, length, angle );
+ survive_default_angle_process( so, sensor_id, acode, timecode, length, angle, lh );
}
char* sensor_name[32];