STC单片机省电模式及唤醒#includereg52.hsfrISP=0XE7;sbitPowerOff=P1^7;//待机键sbitDownLoad=P1^6;voidDelay(unsignedinti){while(i--);}voidEXI0()interrupt0{P0=0XFA;P2=0XFF;}voidinit(){IT0=1;EX0=1;EA=1;}voidmain(){init();//初始化while(1){if(PowerOff==0){Delay(10000);while(PowerOff==0);P0=0XFE;PCON=0X02;}if(DownLoad==0){P2=0X00;Delay(10000);while(DownLoad==0);Delay(20000);ISP=0X60;}};}