The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Thu Nov 08 11:45:42 2018 +0000
Revision:
171:3a7713b1edbc
Parent:
TARGET_NRF51_DK/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_11/libraries/experimental_section_vars/section_vars.h@169:a7c7b631e539
mbed library. Release version 164

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 156:ff21514d8981 1 /*
AnnaBridge 156:ff21514d8981 2 * Copyright (c) 2016 Nordic Semiconductor ASA
AnnaBridge 156:ff21514d8981 3 * All rights reserved.
AnnaBridge 156:ff21514d8981 4 *
AnnaBridge 156:ff21514d8981 5 * Redistribution and use in source and binary forms, with or without modification,
AnnaBridge 156:ff21514d8981 6 * are permitted provided that the following conditions are met:
AnnaBridge 156:ff21514d8981 7 *
AnnaBridge 156:ff21514d8981 8 * 1. Redistributions of source code must retain the above copyright notice, this list
AnnaBridge 156:ff21514d8981 9 * of conditions and the following disclaimer.
AnnaBridge 156:ff21514d8981 10 *
AnnaBridge 156:ff21514d8981 11 * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
AnnaBridge 156:ff21514d8981 12 * integrated circuit in a product or a software update for such product, must reproduce
AnnaBridge 156:ff21514d8981 13 * the above copyright notice, this list of conditions and the following disclaimer in
AnnaBridge 156:ff21514d8981 14 * the documentation and/or other materials provided with the distribution.
AnnaBridge 156:ff21514d8981 15 *
AnnaBridge 156:ff21514d8981 16 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
AnnaBridge 156:ff21514d8981 17 * used to endorse or promote products derived from this software without specific prior
AnnaBridge 156:ff21514d8981 18 * written permission.
AnnaBridge 156:ff21514d8981 19 *
AnnaBridge 156:ff21514d8981 20 * 4. This software, with or without modification, must only be used with a
AnnaBridge 156:ff21514d8981 21 * Nordic Semiconductor ASA integrated circuit.
AnnaBridge 156:ff21514d8981 22 *
AnnaBridge 156:ff21514d8981 23 * 5. Any software provided in binary or object form under this license must not be reverse
AnnaBridge 156:ff21514d8981 24 * engineered, decompiled, modified and/or disassembled.
AnnaBridge 156:ff21514d8981 25 *
AnnaBridge 156:ff21514d8981 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
AnnaBridge 156:ff21514d8981 27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
AnnaBridge 156:ff21514d8981 28 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 156:ff21514d8981 29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
AnnaBridge 156:ff21514d8981 30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
AnnaBridge 156:ff21514d8981 31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
AnnaBridge 156:ff21514d8981 32 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
AnnaBridge 156:ff21514d8981 33 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
AnnaBridge 156:ff21514d8981 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
AnnaBridge 156:ff21514d8981 35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 156:ff21514d8981 36 *
AnnaBridge 156:ff21514d8981 37 */
AnnaBridge 156:ff21514d8981 38
AnnaBridge 156:ff21514d8981 39
AnnaBridge 156:ff21514d8981 40 #ifndef SECTION_VARS_H__
AnnaBridge 156:ff21514d8981 41 #define SECTION_VARS_H__
AnnaBridge 156:ff21514d8981 42
AnnaBridge 156:ff21514d8981 43
AnnaBridge 156:ff21514d8981 44 /**
AnnaBridge 156:ff21514d8981 45 * @defgroup section_vars Section variables
AnnaBridge 156:ff21514d8981 46 * @ingroup app_common
AnnaBridge 156:ff21514d8981 47 * @{
AnnaBridge 156:ff21514d8981 48 *
AnnaBridge 156:ff21514d8981 49 * @brief Section variables.
AnnaBridge 156:ff21514d8981 50 */
AnnaBridge 156:ff21514d8981 51
AnnaBridge 156:ff21514d8981 52 #if defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 53 // Enable IAR language extensions
AnnaBridge 156:ff21514d8981 54 #pragma language=extended
AnnaBridge 156:ff21514d8981 55 #endif
AnnaBridge 156:ff21514d8981 56
AnnaBridge 156:ff21514d8981 57
AnnaBridge 156:ff21514d8981 58 // Macro to delay macro expansion.
AnnaBridge 156:ff21514d8981 59 #define NRF_PRAGMA(x) _Pragma(#x)
AnnaBridge 156:ff21514d8981 60
AnnaBridge 156:ff21514d8981 61
AnnaBridge 156:ff21514d8981 62 /**@brief Macro to register a named section.
AnnaBridge 156:ff21514d8981 63 *
AnnaBridge 156:ff21514d8981 64 * @param[in] section_name Name of the section to register.
AnnaBridge 156:ff21514d8981 65 */
AnnaBridge 156:ff21514d8981 66 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 67
AnnaBridge 156:ff21514d8981 68 // Not required by this compiler.
AnnaBridge 156:ff21514d8981 69 #define NRF_SECTION_VARS_REGISTER_SECTION(section_name)
AnnaBridge 156:ff21514d8981 70
AnnaBridge 156:ff21514d8981 71 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 72
AnnaBridge 156:ff21514d8981 73 // Not required by this compiler.
AnnaBridge 156:ff21514d8981 74 #define NRF_SECTION_VARS_REGISTER_SECTION(section_name)
AnnaBridge 156:ff21514d8981 75
AnnaBridge 156:ff21514d8981 76 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 77
AnnaBridge 156:ff21514d8981 78 #define NRF_SECTION_VARS_REGISTER_SECTION(section_name) NRF_PRAGMA(section = #section_name)
AnnaBridge 156:ff21514d8981 79
AnnaBridge 156:ff21514d8981 80 #endif
AnnaBridge 156:ff21514d8981 81
AnnaBridge 156:ff21514d8981 82
AnnaBridge 156:ff21514d8981 83 /*lint -save -e27 */
AnnaBridge 156:ff21514d8981 84
AnnaBridge 156:ff21514d8981 85 /**@brief Macro to obtain the linker symbol for the beginning of a given section.
AnnaBridge 156:ff21514d8981 86 *
AnnaBridge 156:ff21514d8981 87 * @details The symbol that this macro resolves to is used to obtain a section start address.
AnnaBridge 156:ff21514d8981 88 *
AnnaBridge 156:ff21514d8981 89 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 90 */
AnnaBridge 156:ff21514d8981 91 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 92
AnnaBridge 156:ff21514d8981 93 #define NRF_SECTION_VARS_START_SYMBOL(section_name) section_name ## $$Base
AnnaBridge 156:ff21514d8981 94
AnnaBridge 156:ff21514d8981 95 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 96
AnnaBridge 156:ff21514d8981 97 #define NRF_SECTION_VARS_START_SYMBOL(section_name) __start_ ## section_name
AnnaBridge 156:ff21514d8981 98
AnnaBridge 156:ff21514d8981 99 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 100
AnnaBridge 156:ff21514d8981 101 #define NRF_SECTION_VARS_START_SYMBOL(section_name) __section_begin(#section_name)
AnnaBridge 156:ff21514d8981 102
AnnaBridge 156:ff21514d8981 103 #endif
AnnaBridge 156:ff21514d8981 104
AnnaBridge 156:ff21514d8981 105
AnnaBridge 156:ff21514d8981 106 /**@brief Macro to obtain the linker symbol for the end of a given section.
AnnaBridge 156:ff21514d8981 107 *
AnnaBridge 156:ff21514d8981 108 * @details The symbol that this macro resolves to is used to obtain a section end address.
AnnaBridge 156:ff21514d8981 109 *
AnnaBridge 156:ff21514d8981 110 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 111 */
AnnaBridge 156:ff21514d8981 112 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 113
AnnaBridge 156:ff21514d8981 114 #define NRF_SECTION_VARS_END_SYMBOL(section_name) section_name ## $$Limit
AnnaBridge 156:ff21514d8981 115
AnnaBridge 156:ff21514d8981 116 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 117
AnnaBridge 156:ff21514d8981 118 #define NRF_SECTION_VARS_END_SYMBOL(section_name) __stop_ ## section_name
AnnaBridge 156:ff21514d8981 119
AnnaBridge 156:ff21514d8981 120 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 121
AnnaBridge 156:ff21514d8981 122 #define NRF_SECTION_VARS_END_SYMBOL(section_name) __section_end(#section_name)
AnnaBridge 156:ff21514d8981 123
AnnaBridge 156:ff21514d8981 124 #endif
AnnaBridge 156:ff21514d8981 125
AnnaBridge 156:ff21514d8981 126 /*lint -restore */
AnnaBridge 156:ff21514d8981 127
AnnaBridge 156:ff21514d8981 128
AnnaBridge 156:ff21514d8981 129 /**@brief Macro for retrieving the length of a given section, in bytes.
AnnaBridge 156:ff21514d8981 130 *
AnnaBridge 156:ff21514d8981 131 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 132 */
AnnaBridge 156:ff21514d8981 133 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 134
AnnaBridge 156:ff21514d8981 135 #define NRF_SECTION_VARS_LENGTH(section_name) \
AnnaBridge 156:ff21514d8981 136 ((uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name))
AnnaBridge 156:ff21514d8981 137
AnnaBridge 156:ff21514d8981 138 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 139
AnnaBridge 156:ff21514d8981 140 #define NRF_SECTION_VARS_LENGTH(section_name) \
AnnaBridge 156:ff21514d8981 141 ((uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name))
AnnaBridge 156:ff21514d8981 142
AnnaBridge 156:ff21514d8981 143 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 144
AnnaBridge 156:ff21514d8981 145 #define NRF_SECTION_VARS_LENGTH(section_name) \
AnnaBridge 156:ff21514d8981 146 ((uint32_t)NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)NRF_SECTION_VARS_START_SYMBOL(section_name))
AnnaBridge 156:ff21514d8981 147
AnnaBridge 156:ff21514d8981 148 #endif
AnnaBridge 156:ff21514d8981 149
AnnaBridge 156:ff21514d8981 150
AnnaBridge 156:ff21514d8981 151 /**@brief Macro to obtain the start address of a named section.
AnnaBridge 156:ff21514d8981 152 *
AnnaBridge 156:ff21514d8981 153 * param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 154 */
AnnaBridge 156:ff21514d8981 155 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 156
AnnaBridge 156:ff21514d8981 157 #define NRF_SECTION_VARS_START_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name)
AnnaBridge 156:ff21514d8981 158
AnnaBridge 156:ff21514d8981 159 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 160
AnnaBridge 156:ff21514d8981 161 #define NRF_SECTION_VARS_START_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name)
AnnaBridge 156:ff21514d8981 162
AnnaBridge 156:ff21514d8981 163 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 164
AnnaBridge 156:ff21514d8981 165 #define NRF_SECTION_VARS_START_ADDR(section_name) (uint32_t)iar_ ## section_name ## _start
AnnaBridge 156:ff21514d8981 166
AnnaBridge 156:ff21514d8981 167 #endif
AnnaBridge 156:ff21514d8981 168
AnnaBridge 156:ff21514d8981 169
AnnaBridge 156:ff21514d8981 170 /*@brief Macro to obtain the end address of a named section.
AnnaBridge 156:ff21514d8981 171 *
AnnaBridge 156:ff21514d8981 172 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 173 */
AnnaBridge 156:ff21514d8981 174 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 175
AnnaBridge 156:ff21514d8981 176 #define NRF_SECTION_VARS_END_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name)
AnnaBridge 156:ff21514d8981 177
AnnaBridge 156:ff21514d8981 178 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 179
AnnaBridge 156:ff21514d8981 180 #define NRF_SECTION_VARS_END_ADDR(section_name) (uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name)
AnnaBridge 156:ff21514d8981 181
AnnaBridge 156:ff21514d8981 182 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 183
AnnaBridge 156:ff21514d8981 184 #define NRF_SECTION_VARS_END_ADDR(section_name) (uint32_t)iar_ ## section_name ## _end
AnnaBridge 156:ff21514d8981 185
AnnaBridge 156:ff21514d8981 186 #endif
AnnaBridge 156:ff21514d8981 187
AnnaBridge 156:ff21514d8981 188
AnnaBridge 156:ff21514d8981 189 /**@brief Macro to extern a named section start and stop symbols.
AnnaBridge 156:ff21514d8981 190 *
AnnaBridge 156:ff21514d8981 191 * @note These declarations are required for GCC and Keil linkers (but not for IAR's).
AnnaBridge 156:ff21514d8981 192 *
AnnaBridge 156:ff21514d8981 193 * @param[in] type_name Name of the type stored in the section.
AnnaBridge 156:ff21514d8981 194 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 195 */
AnnaBridge 156:ff21514d8981 196 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 197
AnnaBridge 156:ff21514d8981 198 #define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name) \
AnnaBridge 156:ff21514d8981 199 extern type_name * NRF_SECTION_VARS_START_SYMBOL(section_name); \
AnnaBridge 156:ff21514d8981 200 extern void * NRF_SECTION_VARS_END_SYMBOL(section_name)
AnnaBridge 156:ff21514d8981 201
AnnaBridge 156:ff21514d8981 202 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 203
AnnaBridge 156:ff21514d8981 204 #define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name) \
AnnaBridge 156:ff21514d8981 205 extern type_name * NRF_SECTION_VARS_START_SYMBOL(section_name); \
AnnaBridge 156:ff21514d8981 206 extern void * NRF_SECTION_VARS_END_SYMBOL(section_name)
AnnaBridge 156:ff21514d8981 207
AnnaBridge 156:ff21514d8981 208 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 209
AnnaBridge 156:ff21514d8981 210 // No symbol registration required for IAR.
AnnaBridge 156:ff21514d8981 211 #define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name) \
AnnaBridge 156:ff21514d8981 212 extern void * iar_ ## section_name ## _start = __section_begin(#section_name); \
AnnaBridge 156:ff21514d8981 213 extern void * iar_ ## section_name ## _end = __section_end(#section_name)
AnnaBridge 156:ff21514d8981 214
AnnaBridge 156:ff21514d8981 215 #endif
AnnaBridge 156:ff21514d8981 216
AnnaBridge 156:ff21514d8981 217
AnnaBridge 156:ff21514d8981 218 /**@brief Macro to declare a variable to be placed in a named section.
AnnaBridge 156:ff21514d8981 219 *
AnnaBridge 156:ff21514d8981 220 * @details Declares a variable to be placed in a named section. This macro ensures that its symbol
AnnaBridge 156:ff21514d8981 221 * is not stripped by the linker because of optimizations.
AnnaBridge 156:ff21514d8981 222 *
AnnaBridge 156:ff21514d8981 223 * @warning The order with which variables are placed in a section is implementation dependant.
AnnaBridge 156:ff21514d8981 224 * Generally, variables are placed in a section depending on the order with which they
AnnaBridge 156:ff21514d8981 225 * are found by the linker.
AnnaBridge 156:ff21514d8981 226 *
AnnaBridge 156:ff21514d8981 227 * @warning The symbols added in the named section must be word aligned to prevent padding.
AnnaBridge 156:ff21514d8981 228 *
AnnaBridge 156:ff21514d8981 229 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 230 * @param[in] type_def Datatype of the variable to place in the given section.
AnnaBridge 156:ff21514d8981 231 */
AnnaBridge 156:ff21514d8981 232 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 233
AnnaBridge 156:ff21514d8981 234 #define NRF_SECTION_VARS_ADD(section_name, type_def) \
AnnaBridge 156:ff21514d8981 235 static type_def __attribute__ ((section(#section_name))) __attribute__((used))
AnnaBridge 156:ff21514d8981 236
AnnaBridge 156:ff21514d8981 237 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 238
AnnaBridge 156:ff21514d8981 239 #define NRF_SECTION_VARS_ADD(section_name, type_def) \
AnnaBridge 156:ff21514d8981 240 static type_def __attribute__ ((section("."#section_name))) __attribute__((used))
AnnaBridge 156:ff21514d8981 241
AnnaBridge 156:ff21514d8981 242 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 243
AnnaBridge 156:ff21514d8981 244 #define NRF_SECTION_VARS_ADD(section_name, type_def) \
AnnaBridge 156:ff21514d8981 245 static __root type_def @ #section_name
AnnaBridge 156:ff21514d8981 246
AnnaBridge 156:ff21514d8981 247 #endif
AnnaBridge 156:ff21514d8981 248
AnnaBridge 156:ff21514d8981 249
AnnaBridge 156:ff21514d8981 250 /**@brief Macro to get symbol from named section.
AnnaBridge 156:ff21514d8981 251 *
AnnaBridge 156:ff21514d8981 252 * @warning The stored symbol can only be resolved using this macro if the
AnnaBridge 156:ff21514d8981 253 * type of the data is word aligned. The operation of acquiring
AnnaBridge 156:ff21514d8981 254 * the stored symbol relies on sizeof of the stored type, no
AnnaBridge 156:ff21514d8981 255 * padding can exist in the named section in between individual
AnnaBridge 156:ff21514d8981 256 * stored items or this macro will fail.
AnnaBridge 156:ff21514d8981 257 *
AnnaBridge 156:ff21514d8981 258 * @param[in] i Index of item in section.
AnnaBridge 156:ff21514d8981 259 * @param[in] type_name Type name of item in section.
AnnaBridge 156:ff21514d8981 260 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 261 */
AnnaBridge 156:ff21514d8981 262 #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
AnnaBridge 156:ff21514d8981 263
AnnaBridge 156:ff21514d8981 264 #define NRF_SECTION_VARS_GET(i, type_name, section_name) \
AnnaBridge 156:ff21514d8981 265 (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))
AnnaBridge 156:ff21514d8981 266
AnnaBridge 156:ff21514d8981 267 #elif defined(__GNUC__)
AnnaBridge 156:ff21514d8981 268
AnnaBridge 156:ff21514d8981 269 #define NRF_SECTION_VARS_GET(i, type_name, section_name) \
AnnaBridge 156:ff21514d8981 270 (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))
AnnaBridge 156:ff21514d8981 271
AnnaBridge 156:ff21514d8981 272 #elif defined(__ICCARM__)
AnnaBridge 156:ff21514d8981 273
AnnaBridge 156:ff21514d8981 274 #define NRF_SECTION_VARS_GET(i, type_name, section_name) \
AnnaBridge 156:ff21514d8981 275 (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))
AnnaBridge 156:ff21514d8981 276
AnnaBridge 156:ff21514d8981 277 #endif
AnnaBridge 156:ff21514d8981 278
AnnaBridge 156:ff21514d8981 279
AnnaBridge 156:ff21514d8981 280 /**@brief Macro to get number of items in named section.
AnnaBridge 156:ff21514d8981 281 *
AnnaBridge 156:ff21514d8981 282 * @param[in] type_name Type name of item in section.
AnnaBridge 156:ff21514d8981 283 * @param[in] section_name Name of the section.
AnnaBridge 156:ff21514d8981 284 */
AnnaBridge 156:ff21514d8981 285 #define NRF_SECTION_VARS_COUNT(type_name, section_name) \
AnnaBridge 156:ff21514d8981 286 NRF_SECTION_VARS_LENGTH(section_name) / sizeof(type_name)
AnnaBridge 156:ff21514d8981 287
AnnaBridge 156:ff21514d8981 288 /** @} */
AnnaBridge 156:ff21514d8981 289
AnnaBridge 156:ff21514d8981 290 #endif // SECTION_VARS_H__