为了能够使初学者能够有感性认识,现在做了一个阻塞式编程的按键点灯版本.不多说,上代码
#include "extern.h"
BIT LED : PA.6;
BIT KEY : PA.7;
void FPPA0 (void)
{
.ADJUST_IC SYSCLK=IHRC/2
$ LED out ,low;
$ KEY in ,PUll;
while (1)
{
if(!KEY)
{
.delay 10*8000;
if(!KEY)
{
if(!LED)
{
LED=1;
}
else
{
LED=0;
}
while(!KEY)
{
}
}
}
}
}



