创建捕获视频口通道的过程,函数调用大致为:FVID_create -> mdCreateChan -> TVP5154_open-> TVP5154_ctrl -> TVP5154_powerdown -> regSetTVP5154 ->i2c_writeReg -> PSP_i2cTransfer -> DDC_i2cTransfer
走到DDC_i2cTransfer里面的函数如下:
/* Take completion semaphore */
if (i2cObj->currBufferLen > NULL)
{
retCode = PAL_osSemTake(i2cObj->completionSem, timeout); 走到这个函数里面就出不来了。
if (retCode != PAL_SOK)
{
...............
}
}
/* To take a semaphore */
/*This function takes a semaphore token if available. If a semaphore is unavailable, it blocks currently running thread in wait (for specified duration) for a free semaphore*/
PAL_Result PAL_osSemTake(PAL_OsSemHandle hSem, Int32 mSecTimeout)
{
PAL_Result semTakeResult = PAL_SOK;
Bool semPendResult;
if( NULL != hSem )
{
/* Only allow semTake, if it is not called from main */
if (TSK_self() != (TSK_Handle)&KNL_dummy) 1
{
#ifdef PAL_OSSEM_ENABLE_STATIC_MEM
semPendResult = SEM_pend(&((PAL_OsSemObj *) hSem)->biosSemObj, mSecTimeout); 2
#else
semPendResult = SEM_pend(hSem, mSecTimeout);
#endif
if ( semPendResult == FALSE )
{
semTakeResult = PSP_E_RESOURCES;
}
else
{
semTakeResult = PAL_SOK;
}
}
}
else
{
semTakeResult = PSP_E_INVAL_PARAM;
}
return semTakeResult;
}
上面是pal_osSem.c库函数,我的代码在走到return semTakeResult之后,又重新回到1处,接着往下执行到return semTakeResult,然后又回到1,大约反复两次次后,程序走到2后该函数内外的断点都端不住了,程序就飞了,请问什么原因啊?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>