There is a confusing implementation in the porting layer of CC3120. Based on the SDK's demo (with MSP432), in user.h, it says
#define sl_LockObjLock(pLockObj,Timeout) Mutex_lock(*(pLockObj))
which ignores the Timeout parameters. Also, in cc_pal.c, the Mutex_lock points to MutexP_freertos.c, which says:
uintptr_t MutexP_lock(MutexP_Handle handle)
{
SemaphoreHandle_t xMutex = (SemaphoreHandle_t)handle;
/* Retry every 10 ticks */
while (xSemaphoreTakeRecursive(xMutex, (TickType_t)10) == pdFALSE) {
;
}
return (0);
}
Overall, the implementation effectively force the caller to wait forever and ignore the timeout parameter, even the caller want it to return immediately. Is there any specific reason by doing so?