move MAX,MIN,ABS to bits.h

This commit is contained in:
Thomas Kunze
2021-02-08 20:54:49 +01:00
parent f169e20f2f
commit cddef776f7
3 changed files with 31 additions and 23 deletions

View File

@@ -13,6 +13,18 @@
#define ntohl(x) htonl(x)
#endif
#ifndef MIN
#define MIN(a, b) ((a < b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) ((a > b) ? (a) : (b))
#endif
#ifndef ABS
#define ABS(x) ((x > 0) ? (x) : (-x))
#endif
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_STM32)
#include <Arduino.h>
#elif defined(ARDUINO_ARCH_ESP8266)
@@ -106,4 +118,4 @@ enum ParameterFloatEncodings
#undef max
#undef min
// end of temporary undef
#endif
#endif

View File

@@ -12,10 +12,6 @@
#include <stdio.h>
#include <string.h>
#define MIN(a, b) ((a < b) ? (a) : (b))
#define MAX(a, b) ((a > b) ? (a) : (b))
#define ABS(x) ((x > 0) ? (x) : (-x))
// Table for encoding 4-bit data into a 8-bit Manchester encoding.
const uint8_t RfPhysicalLayerCC1101::manchEncodeTab[16] = {0xAA, // 0x0 Manchester encoded
0xA9, // 0x1 Manchester encoded