[an error occurred while processing this directive]
|
char rx_buf0[RxBufSize0];
char rx_head0;
char rx_tail0;
char tx_buf0[TxBufSize0];
char tx_head0;
char tx_tail0;
void Uart0Configuration9600(void)
{
UCTL0 = CHAR+SWRST; // 8-bit character and reset, 8N1
UTCTL0 = SSEL0+SSEL1; // UCLK = SMCLK (8MHz)
UBR00 = 0x41; // 8.00Mhz/9600 - 833 or 341h
UBR10 = 0x03; //
UMCTL0 = 0x00; // no modulation
ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD
UCTL0 &=~SWRST; // end of reset
rx_tail0=0;
rx_head0=0;
IE1 |= URXIE0;//+UTXIE0; // Enable USART0 RX interrupt
}
void SendByteFromBuffer0(void)
{ char d;
if ((IFG1 & UTXIFG0) == 0) return;
if (tx_tail0==tx_head0) return;
d=tx_buf0[tx_tail0];
tx_tail0++;
if (tx_tail0==TxBufSize0) tx_tail0=0;
TXBUF0 = d;
}
E-mail: info@telesys.ru