Commit 1026170f authored by Jacob Vosmaer's avatar Jacob Vosmaer

Uart comments

parent 0618427f
......@@ -25,9 +25,11 @@ ISR(USART_RX_vect)
void
uart_init(void)
{
// Assuming f_cpu is 16 MHz, this gives us 31250 baud
UBRR0H = 0;
UBRR0L = 31;
// Enable UART0 RX and RX interrupt
UCSR0B = _BV(RXEN0) | _BV(RXCIE0);
// Enable pull-up resistor on RX pin
......@@ -43,7 +45,6 @@ uint16_t
uart_read(void)
{
if (buffer_empty()) {
// No UART data available
return UART_ERROR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment