From a352c2f4e3a480178750795537db8a65dabc75b0 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Tue, 5 Apr 2016 18:53:14 -0700 Subject: [PATCH] EKF: Fix posix build error Memset cannot be used on a class like this. Setting the time elements to zero achieves the desired result. --- EKF/RingBuffer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/EKF/RingBuffer.h b/EKF/RingBuffer.h index 5e7af56d83..376d8e5851 100644 --- a/EKF/RingBuffer.h +++ b/EKF/RingBuffer.h @@ -71,7 +71,10 @@ public: } _size = size; - memset(_buffer,0,sizeof(data_type)*_size); + // set the time elements to zero so that bad data is not retrieved from the buffers + for (unsigned index=0; index < _size; index++) { + _buffer[index].time_us = 0; + } _first_write = true; return true; }