From 92432a601fe48f70b3d131f4b8d3498fc76a36c0 Mon Sep 17 00:00:00 2001 From: Samuel Lang Date: Thu, 23 Aug 2018 22:00:20 +0200 Subject: [PATCH] make RunningMedian configurable The defines are not accessible when the library is used as a reference like with PlatformIO hence the `#defines` cannot be overwritten. --- libraries/RunningMedian/RunningMedian.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libraries/RunningMedian/RunningMedian.h b/libraries/RunningMedian/RunningMedian.h index 55428ba3..040acff7 100644 --- a/libraries/RunningMedian/RunningMedian.h +++ b/libraries/RunningMedian/RunningMedian.h @@ -2,7 +2,7 @@ // FILE: RunningMedian.h // AUTHOR: Rob dot Tillaart at gmail dot com // PURPOSE: RunningMedian library for Arduino -// VERSION: 0.1.14 +// VERSION: 0.1.15 // URL: http://arduino.cc/playground/Main/RunningMedian // HISTORY: See RunningMedian.cpp // @@ -20,7 +20,7 @@ #include -#define RUNNING_MEDIAN_VERSION "0.1.14" +#define RUNNING_MEDIAN_VERSION "0.1.15" // prepare for dynamic version // not tested use at own risk :) @@ -28,14 +28,20 @@ // conditional compile to minimize lib // by removeing a lot of functions. +#ifndef RUNNING_MEDIAN_ALL #define RUNNING_MEDIAN_ALL +#endif // should at least be 5 to be practical // odd size results in a 'real' middle element. // even size takes the lower of the two middle elements +#ifndef MEDIAN_MIN_SIZE #define MEDIAN_MIN_SIZE 1 +#endif +#ifndef MEDIAN_MAX_SIZE #define MEDIAN_MAX_SIZE 19 // adjust if needed +#endif class RunningMedian