X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-stmload%2Fao-stmload.c;h=dd25f07f8e0cb6f2d355a15a72c1e09931a1c92e;hp=130f8707c75da8a0cb5c30952439c050d9403cf0;hb=1695f6af46ea647119d651fc09c97d604d08c736;hpb=f6d6df03826083a244715b88a30ad681f17b4510 diff --git a/ao-tools/ao-stmload/ao-stmload.c b/ao-tools/ao-stmload/ao-stmload.c index 130f8707..dd25f07f 100644 --- a/ao-tools/ao-stmload/ao-stmload.c +++ b/ao-tools/ao-stmload/ao-stmload.c @@ -224,12 +224,13 @@ static const struct option options[] = { { .name = "device", .has_arg = 1, .val = 'D' }, { .name = "cal", .has_arg = 1, .val = 'c' }, { .name = "serial", .has_arg = 1, .val = 's' }, + { .name = "verbose", .has_arg = 0, .val = 'v' }, { 0, 0, 0, 0}, }; static void usage(char *program) { - fprintf(stderr, "usage: %s [--stlink] [--device=] [-tty=] [--cal=] [--serial=] file.{elf,ihx}\n", program); + fprintf(stderr, "usage: %s [--stlink] [--verbose] [--device=] [-tty=] [--cal=] [--serial=] file.{elf,ihx}\n", program); exit(1); } @@ -286,8 +287,9 @@ main (int argc, char **argv) int use_stlink = 0; char *tty = NULL; int success; + int verbose = 0; - while ((c = getopt_long(argc, argv, "T:D:c:s:S", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "T:D:c:s:Sv", options, NULL)) != -1) { switch (c) { case 'T': tty = optarg; @@ -308,12 +310,20 @@ main (int argc, char **argv) case 'S': use_stlink = 1; break; + case 'v': + verbose++; + break; default: usage(argv[0]); break; } } + ao_self_verbose = verbose; + + if (verbose > 1) + ccdbg_add_debug(CC_DEBUG_BITBANG); + filename = argv[optind]; if (filename == NULL) usage(argv[0]); @@ -412,6 +422,7 @@ main (int argc, char **argv) fprintf(stderr, "Cannot switch to boot loader\n"); exit(1); } +#if 0 { uint8_t check[256]; int i = 0; @@ -433,6 +444,7 @@ main (int argc, char **argv) } } } +#endif } /* Go fetch existing config values