diff options
author | cnlohr <lohr85@gmail.com> | 2017-02-16 15:47:46 -0500 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2017-02-16 15:47:46 -0500 |
commit | 2e5d0355da2376f27dcbe0cc6d04b737145ac853 (patch) | |
tree | 1beb6bd36c9ff98998aed0980f42b96ede650b45 /calibrate.c | |
parent | f2d014016d73f067c224ee222bc3eab910848914 (diff) | |
download | libsurvive-2e5d0355da2376f27dcbe0cc6d04b737145ac853.tar.gz libsurvive-2e5d0355da2376f27dcbe0cc6d04b737145ac853.tar.bz2 |
update with more integration stuff.
Diffstat (limited to 'calibrate.c')
-rw-r--r-- | calibrate.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/calibrate.c b/calibrate.c index 4db2ed0..ce50b67 100644 --- a/calibrate.c +++ b/calibrate.c @@ -40,6 +40,36 @@ int buffertimeto[32*3]; void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length ) { survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length ); + + if( acode == -1 ) return; +//return; + int jumpoffset = sensor_id; + if( strcmp( so->codename, "WM0" ) == 0 ) jumpoffset += 32; + else if( strcmp( so->codename, "WM1" ) == 0 ) jumpoffset += 64; + + + if( acode == 0 || acode == 2 ) //data = 0 + { + bufferpts[jumpoffset*2+0] = (timeinsweep-100000)/500; + buffertimeto[jumpoffset] = 0; + } + if( acode == 1 || acode == 3 ) //data = 1 + { + bufferpts[jumpoffset*2+1] = (timeinsweep-100000)/500; + buffertimeto[jumpoffset] = 0; + } + + + if( acode == 4 || acode == 6 ) //data = 0 + { + bufferpts[jumpoffset*2+0] = (timeinsweep-100000)/500; + buffertimeto[jumpoffset] = 0; + } + if( acode == 5 || acode == 7 ) //data = 1 + { + bufferpts[jumpoffset*2+1] = (timeinsweep-100000)/500; + buffertimeto[jumpoffset] = 0; + } } void my_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id ) |