aboutsummaryrefslogtreecommitdiff
path: root/src/survive_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/survive_data.c')
-rw-r--r--src/survive_data.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/survive_data.c b/src/survive_data.c
index f5d0e6b..11677e0 100644
--- a/src/survive_data.c
+++ b/src/survive_data.c
@@ -35,7 +35,8 @@ static void handle_lightcap( struct SurviveObject * so, struct LightcapElement *
if( le->type != 0xfe || le->length < 50 ) return;
//le->timestamp += (le->length/2);
- if( le->length > 900 ) //Pulse longer than 18us?
+
+ if( le->length > 2100 ) //Pulse longer indicates a sync pulse.
{
int32_t deltat = (uint32_t)le->timestamp - (uint32_t)ct->last_photo_time;
if( deltat > 2000 || deltat < -2000 ) //New pulse. (may be inverted)
@@ -65,8 +66,12 @@ static void handle_lightcap( struct SurviveObject * so, struct LightcapElement *
int32_t acode = (tpco+125)/250;
if( acode & 1 ) return;
acode>>=1;
+ acode -= 6;
- survive_light_process( so, le->sensor_id, acode, offset_from, le->timestamp );
+ if( offset_from < 380000 )
+ {
+ survive_light_process( so, le->sensor_id, acode, offset_from, le->timestamp );
+ }
}
else
{