X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-rawload%2Fao-rawload.c;h=255f63eca2f7c99563cbd629c0bd14b969e63e1e;hp=1f1537b9f12d59eb49f6de87c7e96ed39e7e1e1f;hb=73adae3661160d410dcc802873b530d255c210e5;hpb=332b056459b1352e233a8bf5f08498df12d32160 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 ] file.ihx\n", program); + fprintf(stderr, "usage: %s [--tty ] [--device ] 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);