📄 keyprocess1.bak
字号:
#pragma interrupt INTTM02 Inter_TM02 //interrupt serve function name
//Inter_TM2.
/*
** Module name: KeyProcess
**
** Description:
** This module processes key value from the remote control reception.
**
** Operation:
** 1. process the key value received;
** 2. transform it to BCD in Chinese or English input method;
** 3. put it respectively to spelling string.
**
*/
#include "MyDefine.h"
#include "MyRemoteReception.h"
//extern sreg Uchar g_RPTCT;
extern bit g_btRPT;
extern bit btkeyPress; //present the status of any keys
extern bit btKeyPressedTooLong;
extern Uchar g_keyFlgCnt;
static bit btTwoKeys750ms;
//static bit s_btTM02Start;
//static sreg Uchar s_g_TM02Cnt;
/*
** Function name: Inter_TM02
**
** Description:
** The function is ISR - Interrupt Service Routine of timer2
** interval timer and used for the time when any key is pressed.
**
** Input parameters:
** no
**
** Output parameters:
** no
**
** Return value:
** no
*/
void Inter_TM02()
{
/*
static sreg Uchar s_g_TM02Cnt = 0;
static Uchar s_preKeySymbolCnt;
if((g_keyFlgCnt != 0)&&(g_keyFlgCnt == s_preKeySymbolCnt))
{
s_g_TM02Cnt++;
if(s_g_TM02Cnt >= 250)
{
s_g_TM02Cnt = 0;
btTwoKeys750ms = 1;
}
}
if((g_keyFlgCnt != s_preKeySymbolCnt))
{
s_preKeySymbolCnt = g_keyFlgCnt;
s_g_TM02Cnt = 0;
}
*/
static sreg Uchar s_g_TM02Cnt = 0;
static Uchar s_preKeySymbolCnt;
if((g_keyFlgCnt != s_preKeySymbolCnt))
{
s_preKeySymbolCnt = g_keyFlgCnt;
s_g_TM02Cnt = 0;
}
if(g_keyFlgCnt == s_preKeySymbolCnt)
{
s_g_TM02Cnt++;
if(s_g_TM02Cnt >= 250)
{
s_g_TM02Cnt = 0;
btTwoKeys750ms = 1;
}
}
}
//塢崕瓡麡鎺幯旈媆if(g_btRMDTSET){..}泿
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -