X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Fbyteorder.h;h=0ed874bbf68910da09c38ee7565fa05d30cc58ea;hb=HEAD;hp=cf7d137418aafca7bb91c3fe5fa3cbd910954cc3;hpb=aaed3ed803ffbd77b476d71055388cf00232469a;p=bertos.git diff --git a/mware/byteorder.h b/mware/byteorder.h deleted file mode 100755 index cf7d1374..00000000 --- a/mware/byteorder.h +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * \file - * - * - * \brief Functions to convert integers to/from host byte-order. - * - * \version $Id$ - * - * \author Bernardo Innocenti - * \author Stefano Fedrigo - */ - -/* - * $Log$ - * Revision 1.1 2004/07/20 16:26:15 bernie - * Import byte-order macros into DevLib. - * - */ - -#ifndef MWARE_BYTEORDER_H -#define MWARE_BYTEORDER_H - -#include -#include - -INLINE uint16_t cpu_to_be16(uint16_t n); -INLINE uint16_t cpu_to_be16(uint16_t n) -{ - if (CPU_BYTE_ORDER == CPU_LITTLE_ENDIAN) - n = n << 8 | n >> 8; - - return n; -} - -INLINE uint16_t cpu_to_le16(uint16_t n); -INLINE uint16_t cpu_to_le16(uint16_t n) -{ - if (CPU_BYTE_ORDER == CPU_BIG_ENDIAN) - n = n << 8 | n >> 8; - - return n; -} - -#endif /* MWARE_BYTEORDER_H */