Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Main Page
Related Pages
Supported Boards
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Enumerations
Data Structures
Data Structures
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
w
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerator
Related Symbols
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
►
RIOT OS
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2023 Otto-von-Guericke-Universität Magdeburg
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
9
#pragma once
10
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
28
#define CONCAT(a, b) a ## b
29
33
#define CONCAT3(a, b, c) a ## b ## c
34
38
#define CONCAT4(a, b, c, d) a ## b ## c ## d
39
40
/* For compatibility with vendor headers, only provide MAX() and MIN() if not
41
* provided. (The alternative approach of using #undef has the downside that
42
* vendor header files may provide a smarter version of MAX() / MIN() that does
43
* not evaluate the argument twice and rely on this).
44
*/
45
#ifndef MAX
52
#define MAX(a, b) ((a) > (b) ? (a) : (b))
53
#endif
54
55
#ifndef MIN
62
#define MIN(a, b) ((a) < (b) ? (a) : (b))
63
#endif
64
65
#ifndef ABS
72
#define ABS(x) ((x) > 0 ? (x) : -(x))
73
#endif
74
89
#define LIMIT(val, low, high) ((val < low) ? low : (val > high) ? high : val)
90
91
#ifdef __cplusplus
92
}
93
#endif
94
Generated on Sun Apr 27 2025 07:51:02 by
1.12.0