val-off-little/screen/cmd_queue.h

43 lines
921 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* \file cmd_queue.h
* \brief 串口指令队列
* \version 1.0
* \date 2012-2015
* \copyright 广州大彩光电科技有限公司
*/
#ifndef _CMD_QUEUE
#define _CMD_QUEUE
#include "hmi_driver.h"
#include "cmd_process.h"
typedef unsigned char qdata;
typedef unsigned short qsize;
extern uint8_t cmd_buffer[CMD_MAX_SIZE]; //指令缓存
/*!
* \brief 清空指令数据
*/
extern void queue_reset(void);
/*!
* \brief 添加指令数据
* \detial 串口接收的数据,通过此函数放入指令队列
* \param _data 指令数据
*/
extern void queue_push(qdata _data);
/*!
* \brief 从指令队列中取出一条完整的指令
* \param cmd 指令接收缓存区
* \param buf_len 指令接收缓存区大小
* \return 指令长度0表示队列中无完整指令
*/
extern qsize queue_find_cmd(qdata *cmd,qsize buf_len);
extern void ProcessMessage( PCTRL_MSG msg, uint16_t size );
extern void UpdateUI(void);
#endif