Skip to content

Commit 92432a6

Browse files
committed
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.
1 parent f683f58 commit 92432a6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libraries/RunningMedian/RunningMedian.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// FILE: RunningMedian.h
33
// AUTHOR: Rob dot Tillaart at gmail dot com
44
// PURPOSE: RunningMedian library for Arduino
5-
// VERSION: 0.1.14
5+
// VERSION: 0.1.15
66
// URL: http://arduino.cc/playground/Main/RunningMedian
77
// HISTORY: See RunningMedian.cpp
88
//
@@ -20,22 +20,28 @@
2020

2121
#include <inttypes.h>
2222

23-
#define RUNNING_MEDIAN_VERSION "0.1.14"
23+
#define RUNNING_MEDIAN_VERSION "0.1.15"
2424

2525
// prepare for dynamic version
2626
// not tested use at own risk :)
2727
// #define RUNNING_MEDIAN_USE_MALLOC
2828

2929
// conditional compile to minimize lib
3030
// by removeing a lot of functions.
31+
#ifndef RUNNING_MEDIAN_ALL
3132
#define RUNNING_MEDIAN_ALL
33+
#endif
3234

3335

3436
// should at least be 5 to be practical
3537
// odd size results in a 'real' middle element.
3638
// even size takes the lower of the two middle elements
39+
#ifndef MEDIAN_MIN_SIZE
3740
#define MEDIAN_MIN_SIZE 1
41+
#endif
42+
#ifndef MEDIAN_MAX_SIZE
3843
#define MEDIAN_MAX_SIZE 19 // adjust if needed
44+
#endif
3945

4046

4147
class RunningMedian

0 commit comments

Comments
 (0)