这个kill 数据从哪儿来的。
#include <at89x51.h>
#include <stdio.h>
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
void calc();
void pll(unsigned long);
ulong rcdata,nadata,sun,kill;
sbit data=p2^2;
sbit clk=p2^1;
sbit le=p2^0;
void calc()
{
uchar a,cs;
uint n,r;
r=1280;
n=246;
a=12;
cs=6;//cs=l;lds=h;fc=h;sw=l;
rcdata=cs;
rcdata=rcdata<<14;
rcdata=rcdata+r;
rcdata=rcdata<<1;
rcdata=rcdata+1;
nadata=n;
nadata=nadata<<7;
nadata=nadata+a;
nadata=nadata<<1;
}
void pll (ulong kill)//msb first
{
uchar i;
sun=0x40000;
for(i = 0; i < 19; i++)
{
clk=0;
if(kill & sun) //这个kill数据从哪里来的
{
data=1;
}
else
{
data=0;
}
clk=1;
sun=sun>>1;
}
clk=0;
data=0;
le=1;
le=0;
}
void main(void)
{
while(1)
{
le=0;
clk=0;
data=0;
calc();
pll(rcdata);
pll(nadata);
}
}
|