include/sysdep.h
author Edouard Tisserant
Mon, 18 Jun 2012 02:27:19 +0200
changeset 742 10e165c6743c
parent 200 930be51ddc24
permissions -rw-r--r--
pdo.c : missalignment problem on some cpu when comparing cobids, various typo fixes
dcf.c : factorized code, and added automatic state change to operational when DCF finished
drivers/none : default time value is now nanoseconds
#ifndef __sysdep_h__
#define __sysdep_h__

#include "config.h"

#ifdef CANOPEN_BIG_ENDIAN

/* Warning: the argument must not update pointers, e.g. *p++ */

#define UNS16_LE(v)  ((((UNS16)(v) & 0xff00) >> 8) | \
		      (((UNS16)(v) & 0x00ff) << 8))

#define UNS32_LE(v)  ((((UNS32)(v) & 0xff000000) >> 24) |	\
		      (((UNS32)(v) & 0x00ff0000) >> 8)  |	\
		      (((UNS32)(v) & 0x0000ff00) << 8)  |	\
		      (((UNS32)(v) & 0x000000ff) << 24))

#else

#define UNS16_LE(v)  (v)

#define UNS32_LE(v)  (v)

#endif

#endif /* __sysdep_h__ */