|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Lowercase min/max/clamp helpers. More...
#include <zephyr/sys/util.h>Go to the source code of this file.
Macros | |
| #define | max(a, b) |
| Return larger value of two provided expressions. | |
| #define | max3(a, b, c) |
| Return larger value of three provided expressions. | |
| #define | min(a, b) |
| Return smaller value of two provided expressions. | |
| #define | min3(a, b, c) |
| Return smaller value of three provided expressions. | |
| #define | clamp(val, low, high) |
| Return a value clamped to a given range. | |
Lowercase min/max/clamp helpers.
These short-named macros are kept out of util.h so they are not pulled in transitively by broad headers such as <pthread.h>. Source files that need min, max, or clamp should include this header explicitly.
| #define clamp | ( | val, | |
| low, | |||
| high ) |
Return a value clamped to a given range.
Macro ensures that expressions are evaluated only once. See max for macro limitations.
| #define max | ( | a, | |
| b ) |
Return larger value of two provided expressions.
Macro ensures that expressions are evaluated only once.
| #define max3 | ( | a, | |
| b, | |||
| c ) |
Return larger value of three provided expressions.
Macro ensures that expressions are evaluated only once. See max for macro limitations.
| #define min | ( | a, | |
| b ) |
Return smaller value of two provided expressions.
Macro ensures that expressions are evaluated only once. See max for macro limitations.
| #define min3 | ( | a, | |
| b, | |||
| c ) |
Return smaller value of three provided expressions.
Macro ensures that expressions are evaluated only once. See max for macro limitations.