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.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/survive_data.c b/src/survive_data.c
index d8a26af..c586658 100644
--- a/src/survive_data.c
+++ b/src/survive_data.c
@@ -163,7 +163,6 @@ void handle_lightcap2_process_sweep_data(SurviveObject *so)
{
lightcap2_data *lcd = so->disambiguator_data;
-
while(remove_outliers(so));
// look at all of the sensors we found, and process the ones that were hit.
@@ -220,31 +219,22 @@ void handle_lightcap2_process_sweep_data(SurviveObject *so)
//printf("%4d\n", lcd->sweep.sweep_len[i]);
int offset_from = lcd->sweep.sweep_time[i] - lcd->per_sweep.activeSweepStartTime + lcd->sweep.sweep_len[i] / 2;
-
// first, send out the sync pulse data for the last round (for OOTX decoding
- if( !lcd->global.sent_out_ootx_bits ) {
- if (lcd->per_sweep.lh_max_pulse_length[0] != 0)
- {
- so->ctx->lightproc( so, -1,
- handle_lightcap2_getAcodeFromSyncPulse(so, lcd->per_sweep.lh_max_pulse_length[0]),
- lcd->per_sweep.lh_max_pulse_length[0],
- lcd->per_sweep.lh_start_time[0],
- 0,
- 0);
+ if (!lcd->global.sent_out_ootx_bits) {
+ if (lcd->per_sweep.lh_max_pulse_length[0] != 0) {
+ so->ctx->lightproc(
+ so, -1, handle_lightcap2_getAcodeFromSyncPulse(so, lcd->per_sweep.lh_max_pulse_length[0]),
+ lcd->per_sweep.lh_max_pulse_length[0], lcd->per_sweep.lh_start_time[0], 0, 0);
}
- if (lcd->per_sweep.lh_max_pulse_length[1] != 0)
- {
- so->ctx->lightproc( so, -2,
- handle_lightcap2_getAcodeFromSyncPulse(so, lcd->per_sweep.lh_max_pulse_length[1]),
- lcd->per_sweep.lh_max_pulse_length[1],
- lcd->per_sweep.lh_start_time[1],
- 0,
- 1);
+ if (lcd->per_sweep.lh_max_pulse_length[1] != 0) {
+ so->ctx->lightproc(
+ so, -2, handle_lightcap2_getAcodeFromSyncPulse(so, lcd->per_sweep.lh_max_pulse_length[1]),
+ lcd->per_sweep.lh_max_pulse_length[1], lcd->per_sweep.lh_start_time[1], 0, 1);
}
lcd->global.sent_out_ootx_bits = 1;
}
-// if (offset_from < 380000 && offset_from > 70000)
+ // if (offset_from < 380000 && offset_from > 70000)
{
//if (longest_pulse *10 / 8 < lcd->sweep.sweep_len[i])
{
@@ -357,7 +347,6 @@ void handle_lightcap2_sync(SurviveObject * so, LightcapElement * le )
// looks like this is the first sync pulse. Cool!
lcd->global.sent_out_ootx_bits = 0;
-
//fprintf(stderr, "************************************ Reinitializing Disambiguator!!!\n");
// initialize here.
memset(&lcd->per_sweep, 0, sizeof(lcd->per_sweep));