void Encoder_Exe(void)
{
static char biphase;
register char tmp1 = 0;
if(Pin_ENC_F1) tmp1 = 0x40;
if(Pin_ENC_F2) tmp1 |= 0x80;
if((tmp1 & 0xC0) == (biphase & 0xC0)) return;
if(!(tmp1 & 0x40))
{
if(tmp1 == 0)
{
if(biphase == 0xB4)
Keyboard_SetCode(ENC_DN);
}
else
{
if(biphase == 0x1E)
Keyboard_SetCode(ENC_UP);
}
}
biphase >>= 2;
biphase |= tmp1;
}