mraa-gpio.c: Solved issue with getchar() call on Galileo
There is a problem with missing symbols __fgetc_unlocked and __stdin in the libc library build for Galileo. Solved this by replacing the getchar() call with fscanf(). Signed-off-by: Andrei Vasiliu <andrei.vasiliu@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
9b9a5ab168
commit
cb97f24edd
@@ -203,8 +203,11 @@ 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);
|
||||
while (getchar() != '\n')
|
||||
;
|
||||
char aux = 0;
|
||||
do {
|
||||
fflush(stdin);
|
||||
fscanf(stdin, "%c", &aux);
|
||||
} while (aux != '\n');
|
||||
gpio_isr_stop(&gpio_info);
|
||||
} else {
|
||||
fprintf(stdout, "Failed to register ISR for pin %d\n", pin);
|
||||
|
||||
Reference in New Issue
Block a user