switch(Status)
{
case KeyIdle:
{
gudKeyDat = gudKeyInput;
if(3 == gudKeyDat)
Status = KeyIdle;
else
Status = KeyDown;
break;
}
case KeyDown:
{
if(gudKeyInput == gudKeyDat)
Status = KeyPress;
break;
}
case KeyPress:
{
if(gudKeyInput != gudKeyDat)
Status = KeyUp;
break;
}
case KeyUp:
{
if(gudKeyInput != gudKeyDat)
Status = KeyOK;
else
{
Status = KeyPress;
}
break;
}
case KeyOK:
{
gudGetKeyCodeFlg = 1;
Status = KeyIdle;
}
default:
{
Status=KeyIdle;
break;
}
}
应用实现文件 UART_STC51_20110804.rar
文章评论(0条评论)
登录后参与讨论