Files
stc32g128k/App/event.h

33 lines
886 B
C
Raw Normal View History

#ifndef __EVENT_H__
#define __EVENT_H__
#include "config.h"
/* =========================================================================
*
* ========================================================================= */
// 初始化事件队列
void EventQueue_Init(void);
// 将事件推入队列(非阻塞)
// 返回值1-成功0-队列已满
bit EventQueue_Push(SystemEvent evt);
// 从队列头部弹出一个事件
// 返回值:事件结构体,若队列为空则 key_event 为 KEY_EVENT_NONE
SystemEvent EventQueue_Pop(void);
// 判断队列是否为空
bit EventQueue_IsEmpty(void);
// 判断队列是否已满
bit EventQueue_IsFull(void);
// 获取队列中事件数量
u8 EventQueue_GetCount(void);
// 紧急事件直通函数:跳过队列直接发送给应用层
void EventQueue_EmergencyDispatch(SystemEvent evt);
#endif