Section variables.
More...
Section variables.
#define NRF_PRAGMA |
( |
|
x | ) |
_Pragma(#x) |
Macro to delay macro expression of pragma.
#define NRF_SECTION_VARS_ADD |
( |
|
section_name, |
|
|
|
type_def |
|
) |
| static type_def __attribute__((section( #section_name ))) __attribute__((used)) |
Macro to add symbols to a named section.
The symbols are placed in a named section. All calls to this macro will result in symbols being placed in a contiguous manner in the named section. This macro ensures that the symbol is not removed because of optimization level.
- Warning
- There is no guarantee for ordering of placement. If ordering is required
-
The symbols added in the named section must be word aligned to ensure that compilers do not pad the section during symbol placement.
- Parameters
-
[in] | section_name | Name of the section |
[in] | type_def | Datatype of the symbol to place in the given section |
#define NRF_SECTION_VARS_COUNT |
( |
|
type_name, |
|
|
|
section_name |
|
) |
| NRF_SECTION_VARS_LENGTH(section_name) / sizeof(type_name) |
Macro to get number of items in named section.
- Parameters
-
[in] | type_name | Type name of item in section |
[in] | section_name | Name of the section |
#define NRF_SECTION_VARS_END_SYMBOL |
( |
|
section_name | ) |
section_name ## $$Limit |
Macro for accessing end of a named data section by symbol.
The symbol that this macro resolves to is used to access the section by end address.
- Parameters
-
[in] | section_name | Name of the section |
#define NRF_SECTION_VARS_GET |
( |
|
i, |
|
|
|
type_name, |
|
|
|
section_name |
|
) |
| (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name)) |
Macro to get symbol from named section.
- Warning
- The stored symbol can only be resolved using this macro if the type of the data is word aligned. The operation of acquiring the stored symbol relies on sizeof of the stored type, no padding can exist in the named section in between individual stored items or this macro will fail.
- Parameters
-
[in] | i | Index of item in section |
[in] | type_name | Type name of item in section |
[in] | section_name | Name of the section |
Macro for accessing Length of a named section.
This macro is used to get the size of a named section.
- Parameters
-
[in] | section_name | Name of the section |
#define NRF_SECTION_VARS_REGISTER_SECTION |
( |
|
section_name | ) |
|
Macro to register section by name in code.
- Parameters
-
[in] | section_name | Name of the section to register |
#define NRF_SECTION_VARS_REGISTER_SYMBOLS |
( |
|
type_name, |
|
|
|
section_name |
|
) |
| |
Value:
Macro for declaring symbols for named sections.
- Note
- These external declarations of section specific symbols are required for the linker in GCC and Keil (not IAR)
- Parameters
-
[in] | type_name | Name of the type stored in the section |
[in] | section_name | Name of the section |
Macro for accessing the start address of a named section.
param[in] section_name Name of the section to get the start address from
#define NRF_SECTION_VARS_START_SYMBOL |
( |
|
section_name | ) |
section_name ## $$Base |
Macro for accessing start of a named data section by symbol.
The symbol that this macro resolves to is used to access the section by start address.
- Parameters
-
[in] | section_name | Name of the section |