Commit graph

8 commits

Author SHA1 Message Date
Krzysztof Chruściński fe4ea0f326 sys: util: Rework CONCAT to support variable length arguments
Rework CONCAT to accept multiple arugments which are concatenated
together. Number of arguments is limited to 8.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-12 09:57:57 +01:00
Yong Cong Sin 0722c621c8 util: increase several macros limit from 255 to 4095
Currently, the following macros will only work for 0 - 255:
- `IS_EQ`
- `UTIL_X2`
- `UTIL_INC`
- `UTIL_DEC`
- `LISTIFY`

This patch increases their limit to 4095.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-05 06:10:06 -04:00
Andrey VOLKOV c35d97534f include: util_internal: add Z_SPARSE_LIST_{ODD|EVEN}_NUMBERS
Add auxiliary lists Z_SPARSE_LIST_ODD_NUMBERS and
Z_SPARSE_LIST_EVEN_NUMBERS. These lists were originally created for
GPIO_DT_RESERVED_RANGES_NGPIOS macro, but may be useful for others
applications too.

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
2023-07-13 12:16:44 +02:00
Benjamin Cabé 262b72a2fa include: sys: util_macro: remove duplicate DEFINEs
Some UTIL_INC_*** DEFINEs were incorrectly appearing twice.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-13 09:21:00 +02:00
Benjamin Cabé 3544e9163d include: sys: util_macro: fix bogus UTIL_X2 defs
Fixed some invalid defines in the UTIL_X2_*** series.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-13 09:21:00 +02:00
Erwan Gouriou a75af34c3e include: sys: util_macro: Add UTIL_INC/DEC/X2
Add UTIL_INC, UTIL_DEC and UTIL_X2 macros

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-06-06 06:52:42 -04:00
Kumar Gala 9341b98821 sys: util: add a Z_IS_EQ macro to compare integers
This macro compares two integers from 0 to 255 at compile time, using
the preprocessor.

Signed-off-by: Kumar Gala <galak@kernel.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-08-04 17:35:39 +01:00
Yuval Peress 53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Renamed from include/sys/util_internal.h (Browse further)