⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 funcgetch.c

📁 本人编写的无线电话程序,给予PIC18C801设计,包括了uCOS的移植以及菜单,自己设计的拼音注入法,完整地一级汉字库,希望对大家有所帮助
💻 C
字号:
#include "Includes.h"
#include "funccommon.h"
#include "event.h"

//this is a common function to wait for message and discard useless message
//return 0xff for MSG_MENU_CANCEL and key value for key press event
INT8U MFunc_WaitForInput(INT8U val){
	INT8U rom * pMsg;
	INT8U err,retval;
	for(;;){
		pMsg = OSQPend(peventMenu,val,&err);
		if(err==OS_TIMEOUT)
			return(0xFD);
			
		else if((INT24U)pMsg >= PTR_MAX){
			if((INT24U)pMsg == MSG_MENU_CANCEL){
				return(0xff);
			}
		}
		else{
			retval = 0xff;
			if(((MSG_HEAD *)pMsg)->Msg_ID == MSG_MENU_KEY){
				retval = ((MSG_KEYPRESS *)pMsg)->Key;
			}
			Func_Clear_Msg(pMsg);			
			if(retval != 0xff) return(retval);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -