#ifndef __S_TOUCHKEYCFG_H__
#define __S_TOUCHKEYCFG_H__
#define SOCAPI_SET_TOUCHKEY_TOTAL 3
#define SOCAPI_SET_TOUCHKEY_CHANNEL 0x00000007
unsigned int code TKCFG[17] = {1,1,3,3,10,5000,200,100,2,0,1,4,0,65535,65535,65535,21};
unsigned char code TKChannelCfg[3][8]={
0x02,0x0f,0x04,0x08,0x19,0x05,0x01,0xf8,
0x02,0x0f,0x04,0x08,0x15,0x05,0x02,0x11,
0x02,0x0f,0x04,0x08,0x0f,0x05,0x02,0x28,
};
#endif
/**************************************************
*函数名称:void Sys_Scan(void)
*函数功能:扫描TK和显示
*入口参数:void
*出口参数:void
**************************************************/
void Key_scan(void)
{
uint32_t temp=0;
if(SOCAPI_TouchKeyStatus&0x80) //重要步骤2: 触摸键扫描一轮标志,是否调用TouchKeyScan()一定要根据此标志位置起后
{
SOCAPI_TouchKeyStatus &= 0x7f; //重要步骤3: 清除标志位, 需要外部清除。
temp = TouchKeyScan();
if( 3==temp )
{
LED3=~LED3;
}
**_key_event = Generate_keyEvent( temp , &keyEvent );
TouchKeyRestart(); //启动下一轮转换
}
}
特意使用temp 变量观看双键,就是不出,单键都正常.
另外按键是没有观察到keyPress,keydown,keyup的状态,只有抬起手才有按键信息,这不是很科学呀,不知道问题在哪里? |