Loading...
Searching...
No Matches
Utilities to influence the order of auto-initialized modules

Detailed Description

Files

file  auto_init_utils.h
 Auto-initialization utilities.
 

Data Structures

struct  auto_init_module_t
 Type to represent a module to be auto-initialized. More...
 

Macros

#define CONFIG_AUTO_INIT_ENABLE_DEBUG   0
 Print a debug message before a module is initialized.
 
#define AUTO_INIT(function, priority)
 Add a module to the auto-initialization array.
 
#define AUTO_INIT_PRIORITY_AFTER(priority)   RIOT_PP_SUCCESSOR(priority)
 Construct a priority value equal to priority + 1, to be used with AUTO_INIT.
 

Typedefs

typedef void(* auto_init_fn_t) (void)
 Auto-init function type.
 
typedef uint16_t auto_init_prio_t
 Data type to store the priority of a module.
 

Macro Definition Documentation

◆ AUTO_INIT

#define AUTO_INIT (   function,
  priority 
)
Value:
XFA_CONST(auto_init_module_t, auto_init_xfa, priority) \
auto_init_xfa_ ## function \
= { .init = (auto_init_fn_t)function, \
.prio = priority, \
.name = XTSTR(function) }
void(* auto_init_fn_t)(void)
Auto-init function type.
Type to represent a module to be auto-initialized.
#define XFA_CONST(type, xfa_name, prio)
Define variable in read-only cross-file array.
Definition xfa.h:160
#define XTSTR(x)
A macro to return the string representation of x.
Definition xtstr.h:37

Add a module to the auto-initialization array.

Parameters
functionFunction to be called on initialization auto_init_fn_t
priorityPriority level auto_init_prio_t

Definition at line 77 of file auto_init_utils.h.

◆ AUTO_INIT_PRIORITY_AFTER

#define AUTO_INIT_PRIORITY_AFTER (   priority)    RIOT_PP_SUCCESSOR(priority)

Construct a priority value equal to priority + 1, to be used with AUTO_INIT.

Definition at line 94 of file auto_init_utils.h.

◆ CONFIG_AUTO_INIT_ENABLE_DEBUG

#define CONFIG_AUTO_INIT_ENABLE_DEBUG   0

Print a debug message before a module is initialized.

Definition at line 46 of file auto_init_utils.h.

Typedef Documentation

◆ auto_init_fn_t

typedef void(* auto_init_fn_t) (void)

Auto-init function type.

Definition at line 52 of file auto_init_utils.h.

◆ auto_init_prio_t

typedef uint16_t auto_init_prio_t

Data type to store the priority of a module.

Definition at line 57 of file auto_init_utils.h.