1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-29 08:21:18 +01:00

Merge pull request #13956 from benpicco/tests/periph_uart-non_stdio_uart-fix

tests/periph_uart: fix for !stdio_uart
This commit is contained in:
Alexandre Abadie 2020-04-27 09:25:56 +02:00 committed by GitHub
commit 5cc39f98bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,9 +28,12 @@
#include "msg.h"
#include "ringbuffer.h"
#include "periph/uart.h"
#include "stdio_uart.h"
#include "xtimer.h"
#ifdef MODULE_STDIO_UART
#include "stdio_uart.h"
#endif
#ifndef SHELL_BUFSIZE
#define SHELL_BUFSIZE (128U)
#endif
@ -283,11 +286,15 @@ int main(void)
* value given in STDIO_UART_DEV is not a numeral (depends on the CPU
* implementation), so we rather break the output by printing a
* non-numerical value instead of breaking the UART device descriptor */
sleep_test(STDIO_UART_DEV, STDIO_UART_DEV);
if (STDIO_UART_DEV != UART_UNDEF) {
sleep_test(STDIO_UART_DEV, STDIO_UART_DEV);
}
puts("\nUART INFO:");
printf("Available devices: %i\n", UART_NUMOF);
printf("UART used for STDIO (the shell): UART_DEV(%i)\n\n", STDIO_UART_DEV);
if (STDIO_UART_DEV != UART_UNDEF) {
printf("UART used for STDIO (the shell): UART_DEV(%i)\n\n", STDIO_UART_DEV);
}
/* initialize ringbuffers */
for (unsigned i = 0; i < UART_NUMOF; i++) {