void Button0_Debouncer(void)
{
time0=t0; //reset the task timer
switch (PushState0)
{
case NoPush:
if (~PIND == 0x01) PushState0=MaybePush;
else PushState0=NoPush;
break;
case MaybePush:
if (~PIND == 0x01)
{
PushState0=Pushed;
PushFlag0=1;
}
else PushState0=NoPush;
break;
case Pushed:
if (~PIND == 0x01) PushState0=Pushed;
else PushState0=MaybeNoPush;
break;
case MaybeNoPush:
if (~PIND == 0x01) PushState0=Pushed;
else
{
PushState0=NoPush;
PushFlag0=0;
}
break;
}
}
来跟我解释下这个按键是接D口的D几口? |