void init_sci0(void) {
unsigned char readsc0sr =0x00;
SC0BDL = 0x1a; //baud rate :9600
SC0CR1 = 0x00; //8 bits
SC0CR2 = 0x08;
readsc0sr = SC0SR1; //clear Transmit flag
SC0DRL = 0x00;
}
void init_sci1(void){
unsigned char writesc0sr =0x00;
SC1BDL = 0x1a;
SC1CR1 = 0x00;
SC1CR2 = 0x04;
writesc0sr = SC1SR1;
writesc0sr = SC1DRL;
}
黑体部分为清标志位,怎么清楚不了呢? |