Skip to content
Snippets Groups Projects
Commit 501b2572 authored by MrKevinWeiss's avatar MrKevinWeiss
Browse files

tests/periph_uart: fix baudrate truncation

Since some boards an int is 16 bits the atoi truncates values.
This commit using a long instead of an int.
parent bc5e3e77
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@ static int cmd_init(int argc, char **argv)
if (dev < 0) {
return 1;
}
baud = atoi(argv[2]);
baud = strtol(argv[2], NULL, 0);
/* initialize UART */
res = uart_init(UART_DEV(dev), baud, rx_cb, (void *)dev);
......@@ -145,7 +145,7 @@ static int cmd_init(int argc, char **argv)
puts("Error: Unable to initialize UART device\n");
return 1;
}
printf("Success: Successfully initialized UART_DEV(%i)\n", dev);
printf("Success: Initialized UART_DEV(%i) at BAUD %"PRIu32"\n", dev, baud);
/* also test if poweron() and poweroff() work (or at least don't break
* anything) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment