Enabled pullup for RX2 pin (it prevents uart2 from rx buffer overflow in case of disconnected MMU)

This commit is contained in:
Robert Pelnar 2018-08-10 16:20:53 +02:00
parent 923a06c164
commit b16fec956c

View file

@ -34,6 +34,8 @@ int uart2_getchar(FILE *stream)
//uart init (io + FILE stream)
void uart2_init(void)
{
DDRH &= ~0x01;
PORTH |= 0x01;
rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4);
UCSR2A |= (1 << U2X2); // baudrate multiplier
UBRR2L = UART_BAUD_SELECT(UART2_BAUD, F_CPU); // select baudrate