void main(void)
{
if(key_down(key_port,key_pin)==0)
{
// led1_open();
flag++;
if(flag == 3)
{
flag = 0;
}
while(key_down(key_port,key_pin)==0);
}
else
{
// led_close();
// led1_close();
}
INTERRUPT_HANDLER(TIM4_UPD_OVF_IRQHandler, 23)
{
/* In order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction.
*/
TIM4_ClearITPendingBit(TIM4_IT_UPDATE);
//led_reset();
switch(flag)
{
case 0:
led_close();
break;
case 1:
led_open();
break;
case 2:
led_reset();
break;
default:
break;
}
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>