aboutsummaryrefslogtreecommitdiff
path: root/src/survive_data.c
diff options
context:
space:
mode:
authorultramn <dchapm2@umbc.edu>2017-03-08 21:03:46 -0800
committerultramn <dchapm2@umbc.edu>2017-03-08 21:03:46 -0800
commit91598e1806efce519d76c667954fd4c8da74e82e (patch)
treecd68d7b3f20b3ca09881b418f92cc06e65d906c6 /src/survive_data.c
parent3fa72f4b765457ce369d1aa1495dc36c90a94ebf (diff)
parent5629fd458d1de11f604248422473291e434c289f (diff)
downloadlibsurvive-91598e1806efce519d76c667954fd4c8da74e82e.tar.gz
libsurvive-91598e1806efce519d76c667954fd4c8da74e82e.tar.bz2
Merge branch 'master' of https://github.com/cnlohr/libsurvive
Diffstat (limited to 'src/survive_data.c')
-rw-r--r--src/survive_data.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/survive_data.c b/src/survive_data.c
index e55b640..63cc5c2 100644
--- a/src/survive_data.c
+++ b/src/survive_data.c
@@ -6,12 +6,19 @@
#include <string.h>
//This is the disambiguator function, for taking light timing and figuring out place-in-sweep for a given photodiode.
-void handle_lightcap( struct SurviveObject * so, struct LightcapElement * le )
+void handle_lightcap( SurviveObject * so, LightcapElement * le )
{
- struct SurviveContext * ctx = so->ctx;
+ SurviveContext * ctx = so->ctx;
//int32_t deltat = (uint32_t)le->timestamp - (uint32_t)so->last_master_time;
-// printf( "%s %d %d %d %d %d\n", so->codename, le->sensor_id, le->type, le->length, le->timestamp, le->timestamp-so->tsl );
+ //if( so->codename[0] != 'H' )
+ //printf( "*** %s %d %d %d %d %d\n", so->codename, le->sensor_id, le->type, le->length, le->timestamp, le->timestamp-so->tsl );
+
+ if( le->sensor_id > SENSORS_PER_OBJECT )
+ {
+ return;
+ }
+
so->tsl = le->timestamp;
if( le->length < 20 ) return; ///Assuming 20 is an okay value for here.