aboutsummaryrefslogtreecommitdiff
path: root/src/survive_data.c
diff options
context:
space:
mode:
authorJoshua Allen <axlecrusher@gmail.com>2017-03-18 20:23:40 -0400
committerJoshua Allen <axlecrusher@gmail.com>2017-03-18 20:23:40 -0400
commit079ef4516edee08da8a129a0d84249ccb79bbf23 (patch)
tree9e7b109a98957526ceca63b0ddd07fc96f8697a6 /src/survive_data.c
parent4e3ac12016cc489c818709412acd293cac54cb78 (diff)
parent0f94e39d96fbc2744e61b85d2884250d0783eb11 (diff)
downloadlibsurvive-079ef4516edee08da8a129a0d84249ccb79bbf23.tar.gz
libsurvive-079ef4516edee08da8a129a0d84249ccb79bbf23.tar.bz2
Merge branch 'master' of github.com:cnlohr/libsurvive
Diffstat (limited to 'src/survive_data.c')
-rw-r--r--src/survive_data.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/survive_data.c b/src/survive_data.c
index d658e18..16a22e9 100644
--- a/src/survive_data.c
+++ b/src/survive_data.c
@@ -21,17 +21,31 @@ int32_t decode_acode(uint32_t length, int32_t main_divisor) {
//This is the disambiguator function, for taking light timing and figuring out place-in-sweep for a given photodiode.
void handle_lightcap( SurviveObject * so, LightcapElement * le )
{
- SurviveContext * ctx = so->ctx;
+ SurviveContext * ctx = so->ctx;
//int32_t deltat = (uint32_t)le->timestamp - (uint32_t)so->last_master_time;
- //if( so->codename[0] != 'H' )
-
-
if( le->sensor_id > SENSORS_PER_OBJECT )
{
return;
}
+#if 0
+ if( so->codename[0] == 'H' )
+ {
+ static int lt;
+ static int last;
+ if( le->length > 1000 )
+ {
+ int dl = le->timestamp - lt;
+ lt = le->timestamp;
+ if( dl > 10000 || dl < -10000 )
+ printf( "+++%s %3d %5d %9d ", so->codename, le->sensor_id, le->length, dl );
+ if( dl > 100000 ) printf(" \n" );
+ }
+ last=le->length;
+ }
+#endif
+
so->tsl = le->timestamp;
if( le->length < 20 ) return; ///Assuming 20 is an okay value for here.
@@ -57,7 +71,7 @@ void handle_lightcap( SurviveObject * so, LightcapElement * le )
{
int is_new_pulse = delta > so->pulselength_min_sync /*1500*/ + last_sync_length;
-// printf("m sync %d %d %d %d\n", le->sensor_id, so->last_sync_time[ssn], le->timestamp, delta);
+ //printf("m sync %d %d %d %d\n", le->sensor_id, so->last_sync_time[ssn], le->timestamp, delta);
so->did_handle_ootx = 0;