Beispiel #1
0
/* init all uarts */
void uart_init(void)
{
#if (defined UDR0) && (defined UART0_COMPILE)
	uart_setconf(0, NULL);
#endif

#if (defined UDR1) && (defined UART1_COMPILE)
	uart_setconf(1, NULL);
#endif

#if (defined UDR2) && (defined UART2_COMPILE)
	uart_setconf(2, NULL);
#endif

#if (defined UDR3) && (defined UART3_COMPILE)
	uart_setconf(3, NULL);
#endif
}
Beispiel #2
0
/* function called when cmd_baudrate is parsed successfully */
static void cmd_baudrate_parsed(void * parsed_result, void * data)
{
    struct cmd_baudrate_result *res = parsed_result;
    struct uart_config c;

    uart_getconf(1, &c);
    c.baudrate = res->arg1;
    uart_setconf(1, &c);
    printf_P(PSTR("%d %d\r\n"), UBRR1H, UBRR1L);
}