Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Macros
macros.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MEMBER_SIZE(type, member)   (sizeof(((type *) 0)->member))
 
#define WEAK   __attribute((weak))
 
#define NORETURN   __attribute__((noreturn))
 
#define BOOT_SECTION   __attribute__((section(".boot")))
 
#define ARRAY_LENGTH(array)   (sizeof((array)) / sizeof((array)[0]))
 

Macro Definition Documentation

◆ ARRAY_LENGTH

#define ARRAY_LENGTH (   array)    (sizeof((array)) / sizeof((array)[0]))

Returns the number of elements in a statically allocated array. Must not be used on a pointer.

Definition at line 30 of file macros.h.

◆ BOOT_SECTION

#define BOOT_SECTION   __attribute__((section(".boot")))

Places a function in the .boot linker section. Must be placed before the return type in function definitions.

Definition at line 24 of file macros.h.

◆ MEMBER_SIZE

#define MEMBER_SIZE (   type,
  member 
)    (sizeof(((type *) 0)->member))

Macro for the size of a specific structure field.

Definition at line 6 of file macros.h.

◆ NORETURN

#define NORETURN   __attribute__((noreturn))

Marks a function as non-returning (e.g. loops forever or calls exit). Must be placed before the return type in function definitions.

Definition at line 18 of file macros.h.

◆ WEAK

#define WEAK   __attribute((weak))

Marks a function or variable as a weak symbol, allowing application code to override the default SDK implementation by providing a strong definition.

Definition at line 12 of file macros.h.