diff options
| author | Bdale Garbee <bdale@gag.com> | 2009-09-06 10:39:23 -0600 |
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2009-09-06 10:39:23 -0600 |
| commit | 35c54b3a278fa9bc2bc7f4b5ee04866697c93ba0 (patch) | |
| tree | 158e5e258d25e1d1f2ffa55492a3db43c16214ba /ao-tools/ao-rawload/ao-rawload.c | |
| parent | 4f8eff7401ee2d8092ab36fa33411f9b23dda880 (diff) | |
| parent | 6d018ab933832e2d80bb1564c339d9fb18b57be2 (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'ao-tools/ao-rawload/ao-rawload.c')
| -rw-r--r-- | ao-tools/ao-rawload/ao-rawload.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ao-tools/ao-rawload/ao-rawload.c b/ao-tools/ao-rawload/ao-rawload.c index 1f1537b9..255f63ec 100644 --- a/ao-tools/ao-rawload/ao-rawload.c +++ b/ao-tools/ao-rawload/ao-rawload.c @@ -22,12 +22,13 @@ static const struct option options[] = { { .name = "tty", .has_arg = 1, .val = 'T' }, + { .name = "device", .has_arg = 1, .val = 'D' }, { 0, 0, 0, 0}, }; static void usage(char *program) { - fprintf(stderr, "usage: %s [--tty <tty-name>] file.ihx\n", program); + fprintf(stderr, "usage: %s [--tty <tty-name>] [--device <device-name>] file.ihx\n", program); exit(1); } @@ -42,13 +43,17 @@ main (int argc, char **argv) char *filename; FILE *file; char *tty = NULL; + char *device = NULL; int c; - while ((c = getopt_long(argc, argv, "T:", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "T:D:", options, NULL)) != -1) { switch (c) { case 'T': tty = optarg; break; + case 'D': + device = optarg; + break; default: usage(argv[0]); break; @@ -75,6 +80,8 @@ main (int argc, char **argv) } ccdbg_hex_file_free(hex); + if (!tty) + tty = cc_usbdevs_find_by_arg(device, "TIDongle"); dbg = ccdbg_open(tty); if (!dbg) exit (1); |
