?? gressy.h
字號:
//#define SMG P2
unsigned char INPORT;// _at_ 0x2f;
sbit Bot1=P0^0;
sbit Bot2=P0^1;
sbit Bot3=P0^2;
sbit Bot4=P0^3;
sbit Bot5=P0^4;
sbit OKLED=P0^5;
sbit Top1=P0^6;
sbit Top2=P0^7;
sbit Top6=P2^0;
sbit Top5=P2^1;
sbit Top4=P2^2;
sbit Top3=P2^3;
sbit BELL=P2^4;
sbit RECLED=P2^5;
sbit RECERROR=P2^6;
sbit OUTOFRANGE=P2^7;
sbit P10=P1^0;
sbit P11=P1^1;
sbit P12=P1^2;
sbit P13=P1^3;
sbit P14=P1^4;
sbit P15=P1^5;
sbit P16=P1^6;
sbit P17=P1^7;
sbit P30=P3^0;
sbit P31=P3^1;
sbit P32=P3^2;
sbit P33=P3^3;
sbit P34=P3^4;
sbit P35=P3^5;
sbit P36=P3^6;
//sbit RECLED=P0^6;
//sbit RECERROR=P0^7;
//sbit B1=P2^4;
//sbit B2=P2^5;
//sbit B3=P2^6;
/*
sbit REC _at_ 0x70;
bit PLAY _at_ 0x71;
bit STSP _at_ 0x72;
bit LAST _at_ 0x73;
bit NEXT _at_ 0x74;
bit RECERR _at_ 0x77;
*/
//#define REC ((~INPORT)&1)
#define LAST ((~INPORT)&1)
#define NEXT ((~INPORT)&2)
#define ALLTEST ((~INPORT)&4)
#define STSP LAST
#define TYPE ((~INPORT)&8)
//#define REC (~PLAY)
sbit MUTEIN=P1^4;
sbit MUTEOUT=P1^5;
sbit SS=P1^6;
sbit PL=P1^7;
sbit CLK=P3^0;
sbit DATA=P3^1;
sbit INT=P3^3;
sbit MOSI=P3^4;
sbit SCLK=P3^5;
sbit MISO=P3^6;
sbit RAC=P3^7;
//bit OK=0;
///char OKNUM=0;
/*
#define output(px,dx) {PD=dx;px=0;px=1;px=1;px=0;}
#define input(px,dx) {px=1;px=0;px=0;dx=PD;px=1;}
#define delay(x) {count=x;while(count);}
*/
//timer time
#define CYCLE (-10000)
#define MAXNO 8
#define TESTDELAYTIME 40 //40*10ms
#define FLASHTIME 20
#define SHOWTIME (4*FLASHTIME) //must even
#define MAXRECTIME (6000-20) //(6000-20)*10ms~60S
/*
#define CYTIME -500
#define WAITTIME (-3000/CYTIME*250)
#define DELAYTIME (-500/CYTIME*250)
#define ONETIME (-1000/CYTIME*250)
#define STARTSOUNDDELAY (-1000/CYTIME*100)
#define OKSOUNDDELAY (-1000/CYTIME*300)
#define NGSOUNDDELAY (-1000/CYTIME*100)
#define STARTCOUNT (-1000/CYTIME*10)
#define FLASHTIME (-1000/CYTIME*400)
#define LIGHT (-1000/CYTIME*1000)
#define ONELIGHT 10000
#define LEDTESTDELAY (-1000/CYTIME*1500)
#define TESTMASK1 0xbf
#define TESTMASK2 0xff
#define TESTMASK3 0xff
*/
//Interrupt
#define INT0INT 0
#define TIMER0INT 1
#define INT1INT 2
#define TIMER1INT 3
#define COMINT 4
#define TIMER2INT 5
#define CN 20
#define OK (!OKLED)
//list
//code const unsigned char LED[10]={0x3f,0x6,0x5b,0x4f,0x66,0x6d,0x7d,0x7,0x7f,0x67};
//data
//static data unsigned char rd[4];
//static data unsigned char td[3];
//static data unsigned char sd[3];
//static char recordno;
static char playno;
int Input=0;
bit isrecord=0;
bit ledchange=1;
//bit isrecord;
//funtion
void Initial(void);
bit EAB;
//bit start=1;
bit PLAY=1;
#define REC (!PLAY)
static int td;
unsigned int sd;
unsigned char ed=0;
unsigned char md=0;
void Delay(int);
void DelayA(void);
void SendByte(char);
#define MAXROWS 2400
#define PERDURATION (MAXROWS/MAXNO)
#define PowerUp() {EAB=EA;EA=0;SS=0;SS=0;SendByte(0);SendByte(0);SendByte(0x20);EA=EAB;SS=1;}
#define SetPlay(lo,hi) {EAB=EA;EA=0;SS=0;SS=0;SendByte(lo);SendByte(hi);SendByte(0xe0);EA=EAB;SS=1;}
#define Play() {EAB=EA;EA=0;SS=0;SS=0;SendByte(0);SendByte(0);SendByte(0xf0);EA=EAB;SS=1;}
#define SetRec(lo,hi) {EAB=EA;EA=0;SS=0;SS=0;SendByte(lo);SendByte(hi);SendByte(0xa0);EA=EAB;SS=1;}
#define Rec() {EAB=EA;EA=0;SS=0;SS=0;SendByte(0);SendByte(0);SendByte(0xb0);EA=EAB;SS=1;}
#define Stop() {EAB=EA;EA=0;SS=0;SS=0;SendByte(0);SendByte(0);SendByte(0x70);EA=EAB;SS=1;}
#define StopPwrdn() {EAB=EA;EA=0;SS=0;SS=0;SendByte(0);SendByte(0);SendByte(0x50);EA=EAB;SS=1;}
#define LedTest(a,b) {a=1;b=1;Delay(500);a=0;b=0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -