void uart1Init(void) { // initialize the buffers uart1InitBuffers(); // initialize user receive handlers UartRxFunc[1] = 0; // enable RxD/TxD and interrupts outb(UCSR1B, BV(RXCIE1)|BV(TXCIE1)|BV(RXEN1)|BV(TXEN1)); // set default baud rate uartSetBaudRate(1, UART1_DEFAULT_BAUD_RATE); // initialize states uartReadyTx[1] = TRUE; uartBufferedTx[1] = FALSE; // clear overflow count uartRxOverflow[1] = 0; // enable interrupts sei(); }
void uart1Init(void) { // initialize the buffers uart1InitBuffers(); // initialize user receive handlers UartRxFunc[1] = 0; // enable RxD/TxD and interrupts // use (UDRIEn) bit in UCSRnB instead of TXCIE // no TXCIE interrupt since we've got nothing to transmit right now. outb(UCSR1B, _BV(RXCIE)|_BV(RXEN)|_BV(TXEN)); // set default baud rate uartSetBaudRate(1, UART1_DEFAULT_BAUD_RATE); // initialize states uartBufferedTx[1] = FALSE; // clear overflow count uartRxOverflow[1] = 0; // enable interrupts sei(); }