Fix incorrect error checking of prvCreateIdleTasks (#1158)

In environments that do not support static allocation
(configSUPPORT_STATIC_ALLOCATION == 0), at prvCreateIdleTasks(), call
xCreateTask() and compare its return value to pdFAIL to check whether
xCreateTask() failed. However, xCreateTask() returns
errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY as the error value, so the
result of this comparison is always false.

This commit fixes this problem by changing the return value comparison
to pdPASS instead of pdFAIL.
pull/1162/head
kakkoko 4 months ago committed by GitHub
parent 5f3bab1a32
commit a49c35b5dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3630,7 +3630,7 @@ static BaseType_t prvCreateIdleTasks( void )
#endif /* configSUPPORT_STATIC_ALLOCATION */ #endif /* configSUPPORT_STATIC_ALLOCATION */
/* Break the loop if any of the idle task is failed to be created. */ /* Break the loop if any of the idle task is failed to be created. */
if( xReturn == pdFAIL ) if( xReturn != pdPASS )
{ {
break; break;
} }

Loading…
Cancel
Save