1# misra
我认为在Keil uVision 中,加不加volatile都没影响。如:
include<reg52.h>
sbit LED=P3^3;
volatile unsigned char a;
// unsigned char a;
void main()
{
TMOD=0X01;
TH0=75;
TL0=255;
EA=1;
ET0=1;
TR0=1;
a=0;
while(!a)
{
//...
}
LED=0;
while(1);
}
void time0 () interrupt 1
{
TH0=75;
TL0=255;
a=1;
}
//加不加volatile LED都能被点亮,已试过。 |