aboutsummaryrefslogtreecommitdiff
path: root/src/survive_sensor_activations.c
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-03-21 00:53:46 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-03-21 00:54:02 -0600
commitbe3fa4562f9578472de1ded5588df8dc502898c6 (patch)
treed260da6e40563b35a6a9d226b11acd942b394299 /src/survive_sensor_activations.c
parent805b5961274a50a171d0facd791429f6b8e04d63 (diff)
downloadlibsurvive-be3fa4562f9578472de1ded5588df8dc502898c6.tar.gz
libsurvive-be3fa4562f9578472de1ded5588df8dc502898c6.tar.bz2
Tweaked thresholds, played with single sweep solver
Diffstat (limited to 'src/survive_sensor_activations.c')
-rw-r--r--src/survive_sensor_activations.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/survive_sensor_activations.c b/src/survive_sensor_activations.c
index 42de833..d14bbec 100644
--- a/src/survive_sensor_activations.c
+++ b/src/survive_sensor_activations.c
@@ -3,7 +3,8 @@
bool SurviveSensorActivations_isPairValid(const SurviveSensorActivations *self, uint32_t tolerance,
uint32_t timecode_now, uint32_t idx, int lh) {
const uint32_t *data_timecode = self->timecode[idx][lh];
- return !(timecode_now - data_timecode[0] > tolerance || timecode_now - data_timecode[1] > tolerance);
+ return !(timecode_now - data_timecode[0] > tolerance ||
+ timecode_now - data_timecode[1] > tolerance);
}
void SurviveSensorActivations_add(SurviveSensorActivations *self, struct PoserDataLight *lightData) {
@@ -15,5 +16,4 @@ void SurviveSensorActivations_add(SurviveSensorActivations *self, struct PoserDa
*data_timecode = lightData->timecode;
}
-// Roughly 31ms at a 48mhz clock rate
-uint32_t SurviveSensorActivations_default_tolerance = 500000; \ No newline at end of file
+uint32_t SurviveSensorActivations_default_tolerance = (uint32_t) (48000000/*mhz*/ * (16.7 * 2/*ms*/) / 1000); \ No newline at end of file