From 2974af50183af8a8eb71bdb912feaaa8fcfddc01 Mon Sep 17 00:00:00 2001 From: 3djc Date: Wed, 2 Nov 2016 11:10:03 +0100 Subject: [PATCH] Make abs macro AVR specific. This fixes gcc >= 6.2 compile issues. (#3960) * Make abs macro AVR specific. This fixes gcc >= 6.2 compile issues. Tested on gcc 6.2 and 4.9.2 * Since we are getting conflicting result, and only 4 byte diff, lets remove it altogether ! And yeah, there was that typo too ;) --- radio/src/opentx.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 12d535830..38f42b743 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -872,14 +872,10 @@ void doLoopCommonActions(); #define BITMASK(bit) (1<<(bit)) -/// liefert Dimension eines Arrays +/// returns the number of elements of an array #define DIM(arr) (sizeof((arr))/sizeof((arr)[0])) -/// liefert Betrag des Arguments -template FORCEINLINE t abs(t a) { return a>0?a:-a; } -/// liefert das Minimum der Argumente template FORCEINLINE t min(t a, t b) { return a FORCEINLINE t max(t a, t b) { return a>b?a:b; } template FORCEINLINE t sgn(t a) { return a>0 ? 1 : (a < 0 ? -1 : 0); } template FORCEINLINE t limit(t mi, t x, t ma) { return min(max(mi,x),ma); }