1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys: define AUTO_INIT_PRIORITY_AFTER using preprocessor successor

This commit is contained in:
Fabian Hüßler 2022-07-06 00:41:13 +02:00
parent faa0e05f4b
commit 77bce9d758
2 changed files with 13 additions and 0 deletions

View File

@ -990,4 +990,8 @@ ifneq (,$(filter rust_riotmodules,$(USEMODULE)))
include $(RIOTBASE)/sys/rust_riotmodules/Makefile.dep
endif
ifneq (,$(filter auto_init%,$(USEMODULE)))
USEMODULE += preprocessor_successor
endif
include $(RIOTBASE)/sys/test_utils/Makefile.dep

View File

@ -31,6 +31,9 @@
#include "xfa.h"
#include "macros/xtstr.h"
#include "kernel_defines.h"
#if IS_USED(MODULE_PREPROCESSOR_SUCCESSOR)
#include "preprocessor_successor.h"
#endif
#ifdef __cplusplus
extern "C" {
@ -84,6 +87,12 @@ typedef struct {
= { .init = (auto_init_fn_t)function }
#endif
/**
* @brief Construct a priority value equal to @p priority + 1,
* to be used with @ref AUTO_INIT
*/
#define AUTO_INIT_PRIORITY_AFTER(priority) RIOT_PP_SUCCESSOR(priority)
#ifdef __cplusplus
}
#endif