static void CommDrvDefaultProc (uchar value) {
(void)value;
}
void UseDefaultCommProc (void) {
disable();// 在c语言中,这里怎么改写,在对pc串口进行操作时在dos.h中有中断可调用
EvtProcedure = CommDrvDefaultProc;
enable();//在c语言中
}
void initcomm(void){
TMOD = 0x20;
TH1=0Xf3;
TL1=0Xf3;
SCON=0x53;
PCON=0x80;
TR1=1;
IP=0x10;
IE=0x90;
}
void CommEventProc (EventProc Proc) {
disable(); // Disable Interrupts
EvtProcedure = Proc; // Install service handler
enable(); // Enable interrupts
}
void WriteComm (uchar c) {
SBUF = c; // Write char to SCI data register
while (TI==0);// Wait until character gets transmited
TI=0;
}
void UartRxISR(void) interrupt 4 using 3
{
uchar ch;
while(RI==1)
RI=0;
ch=SBUF;
// acknowledge this IRQ
EvtProcedure (SBUF); // Fordward the character to a service routine
}
就是中断接收有问题!!
谢谢回复!!