eMBPoll的分析
在此循环函数中xMBPortEventGet(&eEvent ) == TRUE先判断是否有事件,无事件发生则不进入状态机!
还记得第二节定时器开始工作了吗?我们先看看该定时器如果超时了会发生什么事件!
在超时中断中我们将会调用pxMBPortCBTimerExpired函数,其中有以下代码:
BOOL
xMBRTUTimerT35Expired( void )
{
BOOL xNeedPoll = FALSE;
switch ( eRcvState )
{
/* Timer t35 expired. Startup phase is finished. */
case STATE_RX_INIT:
xNeedPoll = xMBPortEventPost( EV_READY );
break;
/* A frame was received and t35 expired. Notify the listener that
* a new frame was received. */
case STATE_RX_RCV:
xNeedPoll = xMBPortEventPost( EV_FRAME_RECEIVED );
break;
/* An error occured while receiving the frame. */
case STATE_RX_ERROR:
break;
/* Function called in an illegal state. */
default:
assert( ( eRcvState == STATE_RX_INIT )