请问51单片机能不能暂停中断程序并跳转至其它程序中、执行完后跳回中断继续执行中断
请问51单片机能不能从中断程序跳转至其它程序中执行完后跳回中断继续执行中断?例如从中断中跳至case2的地方,执行完case2后跳回中断?voidTraffic_lign...
请问51单片机能不能从中断程序跳转至其它程序中执行完后跳回中断继续执行中断?例如从中断中跳至case 2的地方,执行完case 2后跳回中断?
void Traffic_lignt()
{
switch(Operation_Type)
{
case 1:
RED_A=1;YELLOW_A=1;GREEN_A=0;
RED_B=0;YELLOW_B=1;GREEN_B=1;
DelayMS(2000);
Operation_Type = 2;
break;
case 2:
DelayMS(200);
YELLOW_A=~YELLOW_A;
if(++Flash_Count !=10)
return;
Flash_Count=0;
Operation_Type = 3;
break;
case 3:
RED_A=0;YELLOW_A=1;GREEN_A=1;
RED_B=1;YELLOW_B=1;GREEN_B=0;
DelayMS(2000);
Operation_Type = 4;
break;
case 4:
DelayMS(200);
YELLOW_B=~YELLOW_B;
if(++Flash_Count !=10)
return;
Flash_Count=0;
Operation_Type = 1;
break;
}
} 展开
void Traffic_lignt()
{
switch(Operation_Type)
{
case 1:
RED_A=1;YELLOW_A=1;GREEN_A=0;
RED_B=0;YELLOW_B=1;GREEN_B=1;
DelayMS(2000);
Operation_Type = 2;
break;
case 2:
DelayMS(200);
YELLOW_A=~YELLOW_A;
if(++Flash_Count !=10)
return;
Flash_Count=0;
Operation_Type = 3;
break;
case 3:
RED_A=0;YELLOW_A=1;GREEN_A=1;
RED_B=1;YELLOW_B=1;GREEN_B=0;
DelayMS(2000);
Operation_Type = 4;
break;
case 4:
DelayMS(200);
YELLOW_B=~YELLOW_B;
if(++Flash_Count !=10)
return;
Flash_Count=0;
Operation_Type = 1;
break;
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询