NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
sysdep.h
Go to the documentation of this file.
1
8#ifndef INC_SYSDEP_H_
9#define INC_SYSDEP_H_
10
11#include "config.h"
12
13#ifdef CANOPEN_BIG_ENDIAN
14
15/* Warning: the argument must not update pointers, e.g. *p++ */
16
17#define UNS16_LE(v) ((((UNS16)(v) & 0xff00) >> 8) | \
18 (((UNS16)(v) & 0x00ff) << 8))
19
20#define UNS32_LE(v) ((((UNS32)(v) & 0xff000000) >> 24) | \
21 (((UNS32)(v) & 0x00ff0000) >> 8) | \
22 (((UNS32)(v) & 0x0000ff00) << 8) | \
23 (((UNS32)(v) & 0x000000ff) << 24))
24
25#else
26
27#define UNS16_LE(v) (v)
28
29#define UNS32_LE(v) (v)
30
31#endif
32
33#endif /* INC_SYSDEP_H_ */