Skip to content

Commit ae96b68

Browse files
committed
Fixed static macro usage
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
1 parent 20692a1 commit ae96b68

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

erpc_c/port/erpc_setup_extensions_freertos.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ void erpc_deinit_call_progress_detection_default(void)
6363
{
6464
if (s_erpc_call_in_progress != NULL)
6565
{
66+
#if ERPC_ALLOCATION_POLICY == ERPC_DYNAMIC_POLICY
6667
delete s_erpc_call_in_progress;
68+
#endif
6769
s_erpc_call_in_progress = NULL;
6870
}
6971

erpc_c/port/erpc_threading.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class Thread
228228
TaskHandle_t m_task; /*!< Current task. */
229229
Thread *m_next; /*!< Pointer to next Thread. */
230230
static Thread *s_first; /*!< Pointer to first Thread. */
231-
#if configSUPPORT_STATIC_ALLOCATION
231+
#if ERPC_ALLOCATION_POLICY == ERPC_STATIC_POLICY
232232
StaticTask_t m_staticTask; /*!< Hold static task data. */
233233
#endif
234234
#elif ERPC_THREADS_IS(ZEPHYR)

erpc_c/port/erpc_threading_freertos.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void Thread::start(void *arg)
7171
// which will scan the linked list.
7272
taskENTER_CRITICAL();
7373

74-
#if configSUPPORT_STATIC_ALLOCATION
74+
#if ERPC_ALLOCATION_POLICY == ERPC_STATIC_POLICY
7575
if (m_stackPtr != NULL)
7676
{
7777
m_task =
@@ -205,7 +205,7 @@ void Thread::threadEntryPointStub(void *arg)
205205
Mutex::Mutex(void)
206206
: m_mutex(0)
207207
{
208-
#if configSUPPORT_STATIC_ALLOCATION
208+
#if ERPC_ALLOCATION_POLICY == ERPC_STATIC_POLICY
209209
m_mutex = xSemaphoreCreateRecursiveMutexStatic(&m_staticQueue);
210210
#elif configSUPPORT_DYNAMIC_ALLOCATION
211211
m_mutex = xSemaphoreCreateRecursiveMutex();
@@ -239,7 +239,7 @@ Semaphore::Semaphore(int count)
239239
: m_sem(0)
240240
{
241241
// Set max count to highest signed int.
242-
#if configSUPPORT_STATIC_ALLOCATION
242+
#if ERPC_ALLOCATION_POLICY == ERPC_STATIC_POLICY
243243
m_sem = xSemaphoreCreateCountingStatic(0x7fffffff, count, &m_staticQueue);
244244
#elif configSUPPORT_DYNAMIC_ALLOCATION
245245
m_sem = xSemaphoreCreateCounting(0x7fffffff, count);

0 commit comments

Comments
 (0)