From 19d18fef008792e8918d4ded2dd7fa015bb2fedb Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 5 Mar 2017 09:45:38 -0500 Subject: Set max sensor # so it doesn't get confusd with -1 data. --- src/survive_data.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/survive_data.c b/src/survive_data.c index e55b640..ac640c6 100644 --- a/src/survive_data.c +++ b/src/survive_data.c @@ -11,7 +11,14 @@ void handle_lightcap( struct SurviveObject * so, struct LightcapElement * le ) struct 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. -- cgit v1.2.3