Merge pull request #10698 from MrKevinWeiss/pr/fixsetbaudrate

tests/periph_uart: fix baudrate truncation
This commit is contained in:
Alexandre Abadie 2019-01-03 18:43:36 +01:00 committed by GitHub
commit 5072acc8b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) */