From a1027bceebb36afc4fa9d082277478abd8101eda Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Fri, 20 Apr 2018 22:31:18 -0600 Subject: Enabled and then cleaned up warnings --- src/survive_sensor_activations.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/survive_sensor_activations.c') diff --git a/src/survive_sensor_activations.c b/src/survive_sensor_activations.c index dc5c0d4..e83b2fc 100644 --- a/src/survive_sensor_activations.c +++ b/src/survive_sensor_activations.c @@ -4,6 +4,9 @@ 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]; + if (self->lengths[idx][lh][0] == 0 || self->lengths[idx][lh][1] == 0) + return false; + return !(timecode_now - data_timecode[0] > tolerance || timecode_now - data_timecode[1] > tolerance); } @@ -26,7 +29,7 @@ void SurviveSensorActivations_add(SurviveSensorActivations *self, struct PoserDa *angle = lightData->angle; *data_timecode = lightData->timecode; - *length = lightData->length * 48000000; + *length = (uint32_t)(lightData->length * 48000000); } uint32_t SurviveSensorActivations_default_tolerance = (uint32_t)(48000000 /*mhz*/ * (16.7 * 2 /*ms*/) / 1000) + 5000; -- cgit v1.2.3