#if RotationKEY
BYTE Key_GetRotationKeypadStatus(void)
{
static BYTE ReadRoKey=0,RotationKeyFlag;
BYTE RotationKeyTemp;
RotationKeyTemp=P4;
RotationKeyTemp=(RotationKeyTemp&0x18);
if(RotationKeyTemp==0x00)
{
ReadRoKey=1;
RotationKeyFlag=_LOW;
}
else if(RotationKeyTemp==0x18)
{
ReadRoKey=1;
RotationKeyFlag=_HIGH;
}
if(ReadRoKey)
{
if(RotationKeyFlag==_LOW)
{
if(RotationKeyTemp==0x10)
{
ReadRoKey=0;
return KEY_RIGHT;
}
else if(RotationKeyTemp==0x08)
{
ReadRoKey=0;
return KEY_LEFT;
}
}
else if(RotationKeyFlag==_HIGH)
{
if(RotationKeyTemp==0x08)
{
ReadRoKey=0;
return KEY_RIGHT;
}
else if(RotationKeyTemp==0x10)
{
ReadRoKey=0;
return KEY_LEFT;
}
}
}
return KEY_Idle;
}
#endif