mirror of
https://github.com/thelsing/knx.git
synced 2025-10-12 11:15:54 +02:00
htons() and ntohs() only for SAMD and STM32, but not for Linux and ESP8266 and ESP32
This commit is contained in:
parent
ebfebaaf71
commit
0d6f746f88
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#else
|
#elif ARDUINO_ARCH_SAMD || ARDUINO_ARCH_STM32
|
||||||
#define getbyte(x,n) (*(((uint8_t*)&(x))+n))
|
#define getbyte(x,n) (*(((uint8_t*)&(x))+n))
|
||||||
#define htons(x) ( (getbyte(x,0)<<8) | getbyte(x,1) )
|
#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) )
|
#define htonl(x) ( (getbyte(x,0)<<24) | (getbyte(x,1)<<16) | (getbyte(x,2)<<8) | getbyte(x,3) )
|
||||||
|
Loading…
Reference in New Issue
Block a user