diff options
author | cnlohr <lohr85@gmail.com> | 2016-12-20 23:39:58 -0500 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2016-12-20 23:39:58 -0500 |
commit | 2bce90b5a5095c2327bbbba1d0cc4fdb38426ce0 (patch) | |
tree | a3a955f85472f8888e2837eff821e2dc1f2219e8 /src/survive_data.c | |
parent | 0fb1ec7b12f5c0dbe8e82d7d029e900751fc6c6a (diff) | |
parent | 170219fe413602508b31c39df23c8938adc6c35f (diff) | |
download | libsurvive-2bce90b5a5095c2327bbbba1d0cc4fdb38426ce0.tar.gz libsurvive-2bce90b5a5095c2327bbbba1d0cc4fdb38426ce0.tar.bz2 |
Merge branch 'jpicht-disambiguate'
Diffstat (limited to 'src/survive_data.c')
-rw-r--r-- | src/survive_data.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/survive_data.c b/src/survive_data.c index 660c3e1..6a1656b 100644 --- a/src/survive_data.c +++ b/src/survive_data.c @@ -11,6 +11,7 @@ //All MIT/x11 Licensed Code in this file may be relicensed freely under the GPL or LGPL licenses. #include "survive_internal.h" +#include "disambiguator.h" #include <stdint.h> #include <string.h> @@ -40,7 +41,23 @@ static void handle_lightcap( struct SurviveObject * so, struct LightcapElement * if( le->type != 0xfe || le->length < 50 ) return; //le->timestamp += (le->length/2); - +#if 0 + int32_t offset = le->timestamp - so->d->last; + switch( disambiguator_step( so->d, le->timestamp, le->length ) ) { + default: + case P_UNKNOWN: + // not currently locked + case P_SYNC: + ct->lightproc( so, le->sensor_id, -1, 0, le->timestamp, offset ); + so->d->code = ((le->length+125)/250) - 12; + break; + case P_SWEEP: + if (so->d->code & 1) return; + ct->lightproc( so, le->sensor_id, so->d->code >> 1, offset, le->timestamp, le->length ); + break; + } +#endif +#ifdef USE_OLD_DISAMBIGUATOR if( le->length > 2100 ) //Pulse longer indicates a sync pulse. { int32_t deltat = (uint32_t)le->timestamp - (uint32_t)so->last_photo_time; @@ -85,6 +102,7 @@ static void handle_lightcap( struct SurviveObject * so, struct LightcapElement * { //Runt pulse. } +#endif } |