include/sysdep.h
author fbeaulier
Tue, 16 Aug 2011 14:15:52 +0200
changeset 663 70fc3603e36f
parent 200 930be51ddc24
permissions -rw-r--r--
timers_unix.c : remove sigint and sigterm catch
sdo : Allow multiple servers
The sdo transfer struct is not anymore referenced by server's node id but by
client or server number in the OD. Node id is not relevant in SDO transfert.
200
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     1
#ifndef __sysdep_h__
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     2
#define __sysdep_h__
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     3
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     4
#include "config.h"
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     5
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     6
#ifdef CANOPEN_BIG_ENDIAN
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     7
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     8
/* Warning: the argument must not update pointers, e.g. *p++ */
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
     9
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    10
#define UNS16_LE(v)  ((((UNS16)(v) & 0xff00) >> 8) | \
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    11
		      (((UNS16)(v) & 0x00ff) << 8))
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    12
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    13
#define UNS32_LE(v)  ((((UNS32)(v) & 0xff000000) >> 24) |	\
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    14
		      (((UNS32)(v) & 0x00ff0000) >> 8)  |	\
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    15
		      (((UNS32)(v) & 0x0000ff00) << 8)  |	\
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    16
		      (((UNS32)(v) & 0x000000ff) << 24))
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    17
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    18
#else
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    19
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    20
#define UNS16_LE(v)  (v)
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    21
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    22
#define UNS32_LE(v)  (v)
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    23
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    24
#endif
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    25
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    26
#endif /* __sysdep_h__ */
930be51ddc24 Big Endian fixes.
etisserant
parents:
diff changeset
    27