diff --git a/libraries/Filter/DerivativeFilter.h b/libraries/Filter/DerivativeFilter.h index ad71e0aa7d..031ac5469d 100644 --- a/libraries/Filter/DerivativeFilter.h +++ b/libraries/Filter/DerivativeFilter.h @@ -17,31 +17,32 @@ #include #include -// 1st parameter is the type of data being filtered. +// 1st parameter is the type of data being filtered. // 2nd parameter is the number of elements in the filter template class DerivativeFilter : public FilterWithBuffer { - public: - // constructor - DerivativeFilter() : FilterWithBuffer() {}; +public: + // constructor + DerivativeFilter() : FilterWithBuffer() { + }; - // update - Add a new raw value to the filter, but don't recalculate - virtual void update(T sample, uint32_t timestamp); + // update - Add a new raw value to the filter, but don't recalculate + virtual void update(T sample, uint32_t timestamp); - // return the derivative value - virtual float slope(void); + // return the derivative value + virtual float slope(void); - // reset - clear the filter - virtual void reset(); + // reset - clear the filter + virtual void reset(); - private: - bool _new_data; - float _last_slope; +private: + bool _new_data; + float _last_slope; // microsecond timestamps for samples. This is needed // to cope with non-uniform time spacing of the data - uint32_t _timestamps[FILTER_SIZE]; + uint32_t _timestamps[FILTER_SIZE]; }; typedef DerivativeFilter DerivativeFilterFloat_Size5;