Skip to content

Commit

Permalink
Fix linking error on FreeRTOS when using portYIELD_FROM_ISR
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom747 committed Mar 5, 2024
1 parent 2890823 commit f35233b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion erpc_c/port/erpc_threading_freertos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@

#if ERPC_THREADS_IS(FREERTOS)

// The portYIELD_FROM_ISR() macro declares a variable called
// ulPortYieldRequired. FreeRTOS assumes ulPortYieldRequired is in the
// global namespace. To prevent linking errors, portYIELD_FROM_ISR()
// should not be called from within a namespace.
inline void ErpcPortYieldFromISR(BaseType_t &higher_priority_task_woken) {
portYIELD_FROM_ISR(higher_priority_task_woken);
}

using namespace erpc;

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -248,7 +256,7 @@ void Semaphore::putFromISR(void)
{
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
(void)xSemaphoreGiveFromISR(m_sem, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
ErpcPortYieldFromISR(xHigherPriorityTaskWoken);
}

bool Semaphore::get(uint32_t timeoutUsecs)
Expand Down

0 comments on commit f35233b

Please sign in to comment.