关于事件变量的个人理解
/* ----------------------- Variables ----------------------------------------*/
static eMBEventType eQueuedEvent;
static BOOL xEventInQueue;
eQueuedEvent:
指示队列中的事件类型。变量的类型时enum型。内容如下
//mbport.h
typedef enum
{
EV_READY, /*!< Startup finished. */
EV_FRAME_RECEIVED, /*!< Frame received. */
EV_EXECUTE, /*!< Execute function. */
EV_FRAME_SENT /*!< Frame sent. */
} eMBEventType;
xEventInQueue:
指示是否有事件在队列中
- 事件初始化
BOOL
xMBPortEventInit( void )
{
xEventInQueue = FALSE;
return TRUE;
}
- 事件post
BOOL
xMBPortEventPost( eMBEventType eEvent )
{
xEventInQueue = TRUE;
eQueuedEvent = eEvent;
return TRUE