summaryrefslogtreecommitdiff
path: root/ao-tools/ao-stmload/ao-stmload.c
diff options
context:
space:
mode:
Diffstat (limited to 'ao-tools/ao-stmload/ao-stmload.c')
-rw-r--r--ao-tools/ao-stmload/ao-stmload.c16
1 files changed, 14 insertions, 2 deletions
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=<device>] [-tty=<tty>] [--cal=<radio-cal>] [--serial=<serial>] file.{elf,ihx}\n", program);
+ fprintf(stderr, "usage: %s [--stlink] [--verbose] [--device=<device>] [-tty=<tty>] [--cal=<radio-cal>] [--serial=<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