这是代码,哪错了?#include<reg52.h>#define uchar unsigned char#define uint unsigned intsbit ji=P2^1;uint flag;uchar rx;void delay(uint z){uint x,y;for(x=100;x>0;x--)for(y=z;y>0;y--);}void init(){SCON=0x50;TMOD=0x20;PCON=0x00;TH1=0xfd;TL1=0xfd;EA=1;ES=1;//REN=1;TR1=1;}void main(){init();while(1) { if(flag==0) { ji=1;} delay(1000); if(flag==1) { ji=0; delay(1000); } }}void exter0() interrupt 1{RI=0;rx=SBUF;switch(rx) { case'a':flag=0; break; case'b':flag=1; break; default: break; }} |