Skip to content

Commit 9796985

Browse files
committed
re-instate Arduino macros for min/max
After discussion with Kirk we agreed that ```that's just the way it is``` in Arduino. Solved the TFLM example support by simply placing this at the top of the example ``` c++ #ifdef min #undef min #endif #ifdef max #undef max #endif ```
1 parent 16a2bcd commit 9796985

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/arduino/ard_sup/Arduino_defines.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#undef abs
2929
#endif // abs
3030

31-
// #define min(a, b) ((a) < (b) ? (a) : (b))
32-
// #define max(a, b) ((a) > (b) ? (a) : (b))
31+
#define min(a, b) ((a) < (b) ? (a) : (b))
32+
#define max(a, b) ((a) > (b) ? (a) : (b))
3333
#define abs(x) ((x) > 0 ? (x) : -(x))
3434
#define constrain(amt, low, high) ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt)))
3535
#define round(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))

0 commit comments

Comments
 (0)