include/sysdep.h
author fbeaulier
Mon, 29 Aug 2011 17:31:55 +0200
changeset 665 90e6cf84a0d7
parent 200 930be51ddc24
permissions -rw-r--r--
patch from Christian Taedcke <hacking@taedcke.com> : fix-wrong-resetSDOline-for-sdo-timeout.patch
FIXED: - The sdo line must not be closed at the end of SDOTimeoutAlarm() if the same sdo line is closed and reopened for a new transfer inside the callback. (Patch from Jaroslav Fojtik)
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