Skip to content

Commit

Permalink
#461 Corrected buffer size and loop length
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Nov 26, 2019
1 parent 9858d31 commit 26494d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/src/lighthouse/pulse_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ static void synchronize(pulseProcessor_t *state, int sensor, uint32_t timestamp,

// As soon as one of the history buffers is full, run the synchronization algorithm!
if (state->pulseHistoryPtr[sensor] >= PULSE_PROCESSOR_HISTORY_LENGTH) {
static uint32_t syncTimes[PULSE_PROCESSOR_HISTORY_LENGTH];
static uint32_t syncTimes[PULSE_PROCESSOR_N_SENSORS];
size_t nSyncTimes = 0;

for (int i=0; i<PULSE_PROCESSOR_HISTORY_LENGTH; i++) {
for (int i=0; i<PULSE_PROCESSOR_N_SENSORS; i++) {
if (findSyncTime(state->pulseHistory[i], &syncTimes[nSyncTimes])) {
nSyncTimes += 1;
}
Expand Down

0 comments on commit 26494d9

Please sign in to comment.