mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Update bits.h
This commit is contained in:
parent
cadc6c6124
commit
2ff07d29e3
@ -36,13 +36,13 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode);
|
|||||||
|
|
||||||
#elif ARDUINO_ARCH_SAMD
|
#elif ARDUINO_ARCH_SAMD
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#define htons(x) ( (((x)<<8)&0xFF00) | (((x)>>8)&0xFF) )
|
|
||||||
|
#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) )
|
||||||
#define ntohs(x) htons(x)
|
#define ntohs(x) htons(x)
|
||||||
#define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \
|
|
||||||
((x)<< 8 & 0x00FF0000UL) | \
|
|
||||||
((x)>> 8 & 0x0000FF00UL) | \
|
|
||||||
((x)>>24 & 0x000000FFUL) )
|
|
||||||
#define ntohl(x) htonl(x)
|
#define ntohl(x) htonl(x)
|
||||||
|
|
||||||
#elif ARDUINO_ARCH_ESP8266
|
#elif ARDUINO_ARCH_ESP8266
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <user_interface.h>
|
#include <user_interface.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user