From b39e2ae6beef4e3a60c227f235ef1775487a8a23 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 24 Aug 2010 20:36:46 +0000 Subject: [PATCH] fix multiple calls to gpio_get_value() after switching to the cached file pointer -- need to seek to the start of the stream after every read git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1832 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 6 ++++++ urjtag/src/tap/cable/gpio.c | 1 + 2 files changed, 7 insertions(+) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 94979252..08a5f17b 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,9 @@ +2010-08-24 Mike Frysinger + + * src/tap/cable/gpio.c (gpio_get_value): Need to seek back to the start of + the gpio file after reading the value so we keep getting up-to-date + results as reported by Frans Meulenbroeks. + 2010-08-19 Mike Frysinger * configure.ac, src/tap/cable_list.h, src/tap/cable/generic_usbconn_list.h, diff --git a/urjtag/src/tap/cable/gpio.c b/urjtag/src/tap/cable/gpio.c index 6e4c2c73..efcaec88 100644 --- a/urjtag/src/tap/cable/gpio.c +++ b/urjtag/src/tap/cable/gpio.c @@ -133,6 +133,7 @@ static int gpio_get_value (FILE *fp, unsigned int gpio) int value; ret = fscanf (fp, "%i", &value); + rewind (fp); if (ret != 1) {