void mat_detect(void)
{
static u8 step;
static s16 cnt;
switch (step)
{
case 0:
if (TrayFullSS)
{
Data |= 0x01;
}
if (Jog_btn12)
{
TrayerPushV = 1;
step = 1;
}
break;
case 1:
cnt++;
if (cnt > 100)
{
cnt = 0;
TrayerPushV = 0;
Data <<= 1;
step = 0;
}
break;
default :
step = 0;
break;
}
}
void act(void)
{
static s16 cnt;
if (Data& 0x10)
{
TrayerRiseV = 1;
}
if (TrayerRiseV)
{
cnt++;
if (cnt > 50)
{
cnt = 0;
TrayerRiseV = 0;
Data&= ~0x10;
}
}
}