From 0d6f746f88a78bbc810d82b1630418a7ff7fd58a Mon Sep 17 00:00:00 2001 From: Nanosonde <2073569+nanosonde@users.noreply.github.com> Date: Sun, 8 Nov 2020 15:44:57 +0100 Subject: [PATCH] htons() and ntohs() only for SAMD and STM32, but not for Linux and ESP8266 and ESP32 --- src/knx/bits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/knx/bits.h b/src/knx/bits.h index 27d391a..b6fbdb7 100644 --- a/src/knx/bits.h +++ b/src/knx/bits.h @@ -5,7 +5,7 @@ #ifdef __linux__ #include -#else +#elif ARDUINO_ARCH_SAMD || ARDUINO_ARCH_STM32 #define getbyte(x,n) (*(((uint8_t*)&(x))+n)) #define htons(x) ( (getbyte(x,0)<<8) | getbyte(x,1) ) #define htonl(x) ( (getbyte(x,0)<<24) | (getbyte(x,1)<<16) | (getbyte(x,2)<<8) | getbyte(x,3) )