cc3200 SDK 使用的rtos中, osi_TaskDelete函数是不是有bug?写了一个任务,发现调试经常有问题。
void communica
tion_task( void *pvParameters )
{
int iNewSockID = (int)pvParameters;
int lLoopCount = 0;
int iStatus = 0;
int iTestBufLen = 128;
char g_cBsdBuf[128];
Report("sock id -- %d
", iNewSockID);
while(1) {
osi_Sleep(100); //100ms
iStatus = sprintf(g_cBsdBuf, "x-%d, y-%d, z-%d
", pcAccX, pcAccY, pcAccZ);
iStatus = sl_Send(iNewSockID, g_cBsdBuf, iStatus, 0 );
if( iStatus <= 0 ) {
// error
//ASSERT_ON_ERROR(TCP_SERVER_FAILED);
ERR_PRINT(TCP_SERVER_FAILED);
break;
}
}
// close the connected socket after receiving from connected TCP client
sl_Close(iNewSockID);
osi_TaskDelete(NULL);
}
函数最后调用osi_TaskDelete函数后,经常会出现进入
void
vAssertCalled( const char *pcFile, unsigned long ulLine )
{
//Handle Assert here
while(1)
{
}
}
函数的情况。
有时则是会进入 xTaskWaitingTermination函数, 然后系统就挂起在这里了。
一周热门 更多>