From b32507064d808a6df31bc3c0e35b0b98ab4fede8 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 10 Feb 2015 15:50:59 +0000 Subject: [PATCH] examples/gpio.c: fix getchar() not working in ssh term This is obviously not a nice way to do input handling but it avoids having more code in the samples than is really needed Signed-off-by: Brendan Le Foll --- examples/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gpio.c b/examples/gpio.c index b4cab15..7d7ef70 100644 --- a/examples/gpio.c +++ b/examples/gpio.c @@ -174,7 +174,7 @@ main(int argc, char **argv) if (gpio_isr_start(&gpio_info) == MRAA_SUCCESS) { fprintf(stdout, "Monitoring level changes to pin %d. Press RETURN to exit.\n", pin); gpio_isr_handler(&gpio_info); - getchar(); + while (getchar() != '\n'); gpio_isr_stop(&gpio_info); } else