Skip to content

Commit 8fc7a47

Browse files
committed
Fix linking error on FreeRTOS when using portYIELD_FROM_ISR
1 parent 2890823 commit 8fc7a47

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

erpc_c/port/erpc_threading_freertos.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414

1515
#if ERPC_THREADS_IS(FREERTOS)
1616

17+
// The portYIELD_FROM_ISR() macro declares a variable called
18+
// ulPortYieldRequired. FreeRTOS assumes ulPortYieldRequired is in the
19+
// global namespace. To prevent linking errors, portYIELD_FROM_ISR()
20+
// should not be called from within a namespace.
21+
inline void ErpcPortYieldFromISR(BaseType_t &higher_priority_task_woken)
22+
{
23+
portYIELD_FROM_ISR(higher_priority_task_woken);
24+
}
25+
1726
using namespace erpc;
1827

1928
////////////////////////////////////////////////////////////////////////////////
@@ -248,7 +257,7 @@ void Semaphore::putFromISR(void)
248257
{
249258
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
250259
(void)xSemaphoreGiveFromISR(m_sem, &xHigherPriorityTaskWoken);
251-
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
260+
ErpcPortYieldFromISR(xHigherPriorityTaskWoken);
252261
}
253262

254263
bool Semaphore::get(uint32_t timeoutUsecs)

0 commit comments

Comments
 (0)