|
49 | 49 |
|
50 | 50 | // Detect allocation policy if not already set. |
51 | 51 | #if !defined(ERPC_ALLOCATION_POLICY) |
52 | | - #if defined(__has_include) && __has_include("FreeRTOSConfig.h") |
| 52 | + #if ERPC_HAS_FREERTOSCONFIG_H |
53 | 53 | #ifdef __cplusplus |
54 | | - extern "C" { |
| 54 | + extern "C" { |
55 | 55 | #endif |
56 | 56 | #include "FreeRTOSConfig.h" |
57 | 57 | #ifdef __cplusplus |
58 | | - } |
| 58 | + } |
59 | 59 | #endif |
60 | 60 | #if defined(configSUPPORT_STATIC_ALLOCATION) && configSUPPORT_STATIC_ALLOCATION |
61 | 61 | #define ERPC_ALLOCATION_POLICY (ERPC_ALLOCATION_POLICY_STATIC) |
|
68 | 68 | #endif |
69 | 69 |
|
70 | 70 | #if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC |
71 | | -#if !defined(ERPC_CODEC_COUNT) |
72 | | -#define ERPC_CODEC_COUNT (2U) |
73 | | -#endif |
74 | | -#if !defined(ERPC_MESSAGE_LOGGERS_COUNT) |
75 | | -#define ERPC_MESSAGE_LOGGERS_COUNT (0U) |
76 | | -#endif |
77 | | -#if !defined(ERPC_CLIENTS_THREADS_AMOUNT) |
78 | | -#define ERPC_CLIENTS_THREADS_AMOUNT (1U) |
79 | | -#endif |
| 71 | + #if !defined(ERPC_CODEC_COUNT) |
| 72 | + #define ERPC_CODEC_COUNT (2U) |
| 73 | + #endif |
| 74 | + #if !defined(ERPC_MESSAGE_LOGGERS_COUNT) |
| 75 | + #define ERPC_MESSAGE_LOGGERS_COUNT (0U) |
| 76 | + #endif |
| 77 | + #if !defined(ERPC_CLIENTS_THREADS_AMOUNT) |
| 78 | + #define ERPC_CLIENTS_THREADS_AMOUNT (1U) |
| 79 | + #endif |
80 | 80 | #endif |
81 | 81 |
|
82 | 82 | // Safely detect tx_api.h. |
|
133 | 133 |
|
134 | 134 | //NOEXCEPT support |
135 | 135 | #if defined(__cplusplus) && __cplusplus >= 201103 && ERPC_NOEXCEPT |
136 | | -#define NOEXCEPT noexcept |
| 136 | + #define NOEXCEPT noexcept |
137 | 137 | #else |
138 | | -#define NOEXCEPT |
| 138 | + #define NOEXCEPT |
139 | 139 | #endif // NOEXCEPT |
140 | 140 |
|
141 | 141 | // Disabling nesting calls support as default. |
|
162 | 162 | #endif |
163 | 163 |
|
164 | 164 | #if defined(__CC_ARM) || defined(__ARMCC_VERSION) /* Keil MDK */ |
165 | | -#define THROW_BADALLOC throw(std::bad_alloc) |
166 | | -#define THROW throw() |
| 165 | + #define THROW_BADALLOC throw(std::bad_alloc) |
| 166 | + #define THROW throw() |
167 | 167 | #else |
168 | | -#define THROW_BADALLOC |
169 | | -#define THROW |
| 168 | + #define THROW_BADALLOC |
| 169 | + #define THROW |
170 | 170 | #endif |
171 | 171 |
|
172 | 172 | #ifndef ERPC_TRANSPORT_MU_USE_MCMGR |
|
195 | 195 | #define ERPC_PRE_POST_ACTION_DEFAULT (ERPC_PRE_POST_ACTION_DEFAULT_DISABLED) |
196 | 196 | #endif |
197 | 197 |
|
| 198 | +#if !defined(erpc_assert) |
| 199 | + #if ERPC_HAS_FREERTOSCONFIG_H |
| 200 | + #ifdef __cplusplus |
| 201 | + extern "C" { |
| 202 | + #endif |
| 203 | + #include "FreeRTOS.h" |
| 204 | + #include "task.h" |
| 205 | + #ifdef __cplusplus |
| 206 | + } |
| 207 | + #endif |
| 208 | + #define erpc_assert(condition) configASSERT(condition) |
| 209 | + #elif defined(ERPC_THREADS) && (ERPC_THREADS == ERPC_THREADS_MBED) |
| 210 | + #include "platform/mbed_assert.h" |
| 211 | + #define erpc_assert(condition) MBED_ASSERT(condition) |
| 212 | + #else |
| 213 | + #ifdef __cplusplus |
| 214 | + #include <cassert> |
| 215 | + #else |
| 216 | + #include "assert.h" |
| 217 | + #endif |
| 218 | + #define erpc_assert(condition) assert(condition) |
| 219 | + #endif |
| 220 | +#endif |
| 221 | + |
198 | 222 | /* clang-format on */ |
199 | 223 | #endif // _ERPC_DETECT_H_ |
200 | 224 | //////////////////////////////////////////////////////////////////////////////// |
|
0 commit comments