From c14cfb1436c988eb0a0d26d7c4d83aeccecbc8a3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 5 Apr 2014 18:16:21 -0700 Subject: ao-bringup: Split out easymini test into separate script This lets you run the easy mini testing code without also flashing the device. Signed-off-by: Keith Packard --- ao-bringup/test-flash | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'ao-bringup/test-flash') diff --git a/ao-bringup/test-flash b/ao-bringup/test-flash index c42ddee3..d79de320 100755 --- a/ao-bringup/test-flash +++ b/ao-bringup/test-flash @@ -36,28 +36,6 @@ void flush_input(file f) { } } -string[*] settings(file f) { - string[...] x = {}; - - flush_input(f); - fprintf (f, "c s\nv\n"); - flush(f); - for (;;) { - string l = File::fgets(f); - x[dim(x)] = l; - if (String::index(l, "software-version") == 0) - break; - } - return x; -} - -string[*] find_setting(string[*] s, string match) { - for (int i = 0; i < dim(s); i++) - if (String::index(s[i], match) == 0) - return String::wordsplit(s[i], " "); - return (string[*]) {}; -} - string[*] flash(file f) { string[...] x = {}; @@ -65,7 +43,11 @@ string[*] flash(file f) { fprintf (f, "f\nv\n"); flush(f); for (;;) { - string l = File::fgets(f); + string l = timed_read(f, 1000); + if (l == "") { + File::fprintf(stderr, "Read timedout\n"); + exit(1); + } x[dim(x)] = l; if (String::index(l, "software-version") == 0) break; -- cgit v1.2.3