From a9883018ad1ed99287f73c1dcfbc55c927761331 Mon Sep 17 00:00:00 2001 From: Kristoffer Richardsson Date: Wed, 5 Dec 2018 15:52:50 +0100 Subject: [PATCH] #382 Break loop as soon as possible when looking for sync sequence --- src/utils/src/lighthouse/pulse_processor.c | 1 + test/utils/src/lighthouse/test_pulse_processor.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/src/lighthouse/pulse_processor.c b/src/utils/src/lighthouse/pulse_processor.c index 1bfdeb9baa..9040ba1aad 100644 --- a/src/utils/src/lighthouse/pulse_processor.c +++ b/src/utils/src/lighthouse/pulse_processor.c @@ -57,6 +57,7 @@ static void synchronize(pulseProcessor_t *state, int sensor, uint32_t timestamp, state->synchronized = true; state->lastSync = state->currentSync0; state->currentSync1 = state->currentSync0 + SYNC_SEPARATION; + break; } } diff --git a/test/utils/src/lighthouse/test_pulse_processor.c b/test/utils/src/lighthouse/test_pulse_processor.c index ec79e0b6c2..6a04d668ad 100644 --- a/test/utils/src/lighthouse/test_pulse_processor.c +++ b/test/utils/src/lighthouse/test_pulse_processor.c @@ -306,7 +306,7 @@ void testThatGetSystemSyncTimeDoesNotReturnTimestampIfTooMuchTimestampsSpread() { // Fixture uint32_t unused = 0; - uint32_t syncTimes[8] = {1, 500, 3}; + uint32_t syncTimes[8] = {1, 900, 3}; size_t nSyncTimes = 3; // Test