mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Alexandre Abadie
a4c3d7342a
The test application now prints in a loop the input character. In case stdin is not ready yet after startup this lets the possibility to try to send several time a character before failing. The automatic test is now more robust on platforms where stdin takes time before it gets in a ready state (some AVR, hifive).
28 lines
535 B
C
28 lines
535 B
C
/*
|
|
* Copyright (C) 2019 Inria
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
* directory for more details.
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Shows that stdin module is required when one wants to use getchar
|
|
*
|
|
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
|
*
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
while (1) {
|
|
int value = getchar();
|
|
printf("You entered '%c'\n", (char)value);
|
|
}
|
|
|
|
return 0;
|
|
}
|