Edge AI Add-on API 2.3.0
Loading...
Searching...
No Matches
nrf_edgeai_platform.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6#ifndef _NRF_EDGEAI_PLATFORM_H_
7#define _NRF_EDGEAI_PLATFORM_H_
8
9#include "nrf_edgeai_debug.h"
10
11#define __NRF_EDGEAI_STATIC_INLINE static inline
12
13#if defined(__GNUC__)
14#define __NRF_EDGEAI_WEAK __attribute__((weak))
15#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
16#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
17#define __NRF_EDGEAI_PACKED __attribute__((__packed__))
18
19#define __NRF_EDGEAI_STATIC_FORCEINLINE __attribute__((always_inline)) static inline
20#elif defined(__ICCARM__)
21#define __NRF_EDGEAI_WEAK __weak
22#define __NRF_EDGEAI_PACKED __packed
23#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
24#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
25
26#define __NRF_EDGEAI_STATIC_FORCEINLINE _Pragma("inline=forced") __NRF_EDGEAI_STATIC_INLINE
27#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
28#define __NRF_EDGEAI_WEAK __attribute__((weak))
29#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
30#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
31#define __NRF_EDGEAI_PACKED __attribute__((packed))
32
33#define __NRF_EDGEAI_STATIC_FORCEINLINE __NRF_EDGEAI_STATIC_INLINE
34#else
35#define __NRF_EDGEAI_WEAK __attribute__((weak))
36#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
37#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
38#define __NRF_EDGEAI_PACKED __attribute__((__packed__))
39
40#define __NRF_EDGEAI_STATIC_FORCEINLINE __NRF_EDGEAI_STATIC_INLINE
41#endif
42
43#define NRF_EDGEAI_UNUSED(x) ((void)(x))
44#define NRF_EDGEAI_VOID_VALUE
45
46#ifndef __UNUSED_ARG
47#define __UNUSED_ARG NRF_EDGEAI_UNUSED
48#endif /* __UNUSED_ARG */
49
50#ifndef __VOID_VALUE
51#define __VOID_VALUE NRF_EDGEAI_VOID_VALUE
52#endif /* __VOID_VALUE */
53
54#endif /* _NRF_EDGEAI_PLATFORM_H_ */