你可以设置一个开关变量,在按下P20之后,设置开关变量state=0。然后再在P21的按键判断语句里加上if(P21==0 && state)这样不就行了么?
return 直接结束当前方法
break或者continue