projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix typo in comment
[fw/altos]
/
ao-tools
/
ao-rawload
/
ao-rawload.c
diff --git
a/ao-tools/ao-rawload/ao-rawload.c
b/ao-tools/ao-rawload/ao-rawload.c
index 1f1537b9f12d59eb49f6de87c7e96ed39e7e1e1f..d9ee571829e4ed0eab88dd0cc43ee3f881a3b0f2 100644
(file)
--- 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' },
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)
{
{ 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);
}
exit(1);
}
@@
-42,13
+43,17
@@
main (int argc, char **argv)
char *filename;
FILE *file;
char *tty = NULL;
char *filename;
FILE *file;
char *tty = NULL;
+ char *device = NULL;
int c;
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;
switch (c) {
case 'T':
tty = optarg;
break;
+ case 'D':
+ device = optarg;
+ break;
default:
usage(argv[0]);
break;
default:
usage(argv[0]);
break;
@@
-75,6
+80,8
@@
main (int argc, char **argv)
}
ccdbg_hex_file_free(hex);
}
ccdbg_hex_file_free(hex);
+ if (!tty)
+ tty = cc_usbdevs_find_by_arg(device, "TIDongle");
dbg = ccdbg_open(tty);
if (!dbg)
exit (1);
dbg = ccdbg_open(tty);
if (!dbg)
exit (1);
@@
-98,8
+105,6
@@
main (int argc, char **argv)
ccdbg_close(dbg);
exit(1);
}
ccdbg_close(dbg);
exit(1);
}
- ccdbg_set_pc(dbg, image->address);
- ccdbg_resume(dbg);
ccdbg_close(dbg);
exit (0);
}
ccdbg_close(dbg);
exit (0);
}