void polling_volume_sw(void)
{
BYTE bSWValue=0;
static BYTE iLastData=0;
static BYTE iSWTempData = 0;
#if defined(SUPPORT_USE_SW_SCANF_CODER) || defined(SUPPORT_USE_SW_SCANF_LEVEL)
polling_check_vfdsw();
return;
#elif defined(VOLUME_SW_USE_IO)
GPIO_M_SET(13,1); //GAME DI
GPIO_M_SET(14,1); //GAME DO
GPIO_E_SET(13,0);
GPIO_E_SET(14,0);
bSWValue =( (GPIO_I_GET(14)<<1) | (GPIO_I_GET(13) ));
#endif
if(bSWValue != iSWTempData)
iSWTempData = bSWValue;
else
{
switch(bSWValue)
{
case 0:
if(iLastData ==2)
iLastData ++;
break;
case 1:
if(iLastData ==1)
iLastData++;
else if(iLastData ==3)
{
call_ir_func(IRC_VOLUME_UP);
iLastData = 0;
}
break;
case 2:
if(iLastData ==1)
iLastData ++;
else if(iLastData == 3)
{
call_ir_func(IRC_VOLUME_DN);
iLastData = 0;
}
break;
case 3:
iLastData =1;
break;
default:
break;
}
}
#endif
}
sunplus(dvd) 环境:需源程序支持:
//
// generic GPIO operations
//
#define GPIO_I_GET(a) ((regs0->gpio_in[a/16] >> (a%16)) & 0x01)
#define GPIO_O_SET(a,d) ((d) ? (regs0->gpio_out[a/16] |= (1<<(a%16))) \
: (regs0->gpio_out[a/16] &= ~(1<<(a%16))) )
#define GPIO_E_SET(a,d) ((d) ? (regs0->gpio_oe[a/16] |= (1<<(a%16))) \
: (regs0->gpio_oe[a/16] &= ~(1<<(a%16))) )
#define GPIO_M_SET(a,d) ((d) ? (regs0->gpio_master[a/16] |= (1<<(a%16))) \
: (regs0->gpio_master[a/16] &= ~(1<<(a%16))) )
#ifdef SUPPORT_XINZENYU_JOB_VOLUME //Refee 080905
BYTE volume_a_buf = 0;
BYTE volume_b_buf = 0;
void Check_Job_Volume_Key(void)
{
GPIO_M_SET(13,1); //Pin62 Game_D0
GPIO_M_SET(14,1); //Pin63 Game_D1
GPIO_E_SET(13,1);
GPIO_E_SET(14,1);
GPIO_O_SET(13,1);
GPIO_O_SET(14,1);
volume_a_buf = volume_a_buf<<1;
if(!GPIO_I_GET(13)) volume_a_buf++;
volume_b_buf = volume_b_buf<<1;
if(!GPIO_I_GET(14)) volume_b_buf++;
volume_a_buf = volume_a_buf & 0x7;
volume_b_buf = volume_b_buf & 0x7;
if(volume_a_buf == 0x04)
{
if(volume_b_buf >= 0x06)
call_ir_func(IRC_VOLUME_DN);
else
call_ir_func(IRC_VOLUME_UP);
volume_a_buf = 0;
volume_b_buf = 0;
}
}
#endif