RIOT
RIOT copied to clipboard
sys: preprocessor successor module
Contribution description
Generate a header file, containing successor definitions up to a fixed maximum.
This allows to use the preprocessor to compute the successor of a number and is useful to construct priority values for auto_init
.
This is similar to boost preprocessor arithmetik.
Testing procedure
See usage in tests/external_module_dirs/external_modules/external_module/external_module.c
CFLAGS+=-DCONFIG_AUTO_INIT_ENABLE_DEBUG=1 BOARD=nucleo-f767zi make flash term
2022-07-06 09:39:31,837 # auto_init: ztimer_init (1010)
2022-07-06 09:39:31,840 # auto_init: auto_init_random (1040)
2022-07-06 09:39:31,844 # auto_init: auto_init_external_module (1041)
2022-07-06 09:39:31,847 # auto_init: auto_init_miot_mtd (1249)
2022-07-06 09:39:31,851 # auto_init: auto_init_miot_node (1359)
2022-07-06 09:39:31,860 # main(): This is RIOT! (Version: 2022.07-devel-788-g87bda-preprocessor_successor)
2022-07-06 09:39:31,862 # Message: Linking worked
2022-07-06 09:39:31,863 # Initialization worked!
Issues/PRs references
#18003
@fjmolinas could be interested
I think this is useful for external modules to hook into the auto init code in a more robust fashion.
I think that @gdoffe and many @benpicco may be interested in this. IMO, this only needs a rebase to get in.
Please rebase & squash
Oops forgot the rebase ...
Murdock results
:heavy_check_mark: PASSED
fefd8baef6704cad0acdbf9f35807a7fcb9a46c5 sys/preprocessor: add Kconfig file
Success | Failures | Total | Runtime |
---|---|---|---|
1983 | 0 | 1983 | 07m:47s |
Artifacts
This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.
looks like KConfig is still missing
Please squash!
Thank You!