summaryrefslogtreecommitdiff
path: root/ao-bringup/test-igniter
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-04-04 23:36:34 -0700
committerKeith Packard <keithp@keithp.com>2014-04-05 00:22:30 -0700
commit4800497fa1fc449807ef0097cc3fed367641ae29 (patch)
treede2db32b8b0d55e05fc702d54b0b270c462d6831 /ao-bringup/test-igniter
parent24167015705ae831692b95735968b04a876f935e (diff)
ao-bringup: Get turnon_telemini working
This script now does complete testing of the board Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-bringup/test-igniter')
-rwxr-xr-xao-bringup/test-igniter24
1 files changed, 23 insertions, 1 deletions
diff --git a/ao-bringup/test-igniter b/ao-bringup/test-igniter
index 72dd7723..454f6328 100755
--- a/ao-bringup/test-igniter
+++ b/ao-bringup/test-igniter
@@ -98,10 +98,32 @@ do_igniter(file f, string igniter) {
return true;
}
+file
+open_tty(string name)
+{
+ int i = 0;
+ for (;;) {
+ try {
+ return open (name, "r+");
+ } catch open_error(string error, File::error_type error, string name) {
+ if (error == File::error_type.BUSY) {
+ if (i < 30) {
+ printf ("waiting for %s to be usable\n", name);
+ sleep(2000);
+ continue;
+ }
+ } else {
+ printf ("%s: %s\n", name, error);
+ exit(1);
+ }
+ }
+ }
+}
+
void main () {
string name = argv[1];
string[dim(argv)-2] igniters = { [i] = argv[i+2] };
- file f = open(name, "r+");
+ file f = open_tty(name);
bool ret = true;
for (int i = 0; i < dim(igniters); i++) {