X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-rawload%2Fao-rawload.c;h=c139cda1b46876fb03db2b3b2bfc27efd9044ee6;hb=HEAD;hp=0098b6589c8e9294e9bbda642d13bc20b03809af;hpb=7ac8efea5d60b81adccdc1e38ac4c13facfae7c9;p=fw%2Faltos diff --git a/ao-tools/ao-rawload/ao-rawload.c b/ao-tools/ao-rawload/ao-rawload.c index 0098b658..c139cda1 100644 --- a/ao-tools/ao-rawload/ao-rawload.c +++ b/ao-tools/ao-rawload/ao-rawload.c @@ -38,10 +38,8 @@ int main (int argc, char **argv) { struct ccdbg *dbg; - uint8_t status; - uint16_t pc; - struct hex_file *hex; - struct hex_image *image; + struct ao_hex_file *hex; + struct ao_hex_image *image; char *filename; FILE *file; char *tty = NULL; @@ -49,7 +47,7 @@ main (int argc, char **argv) int c; int run = 0; - while ((c = getopt_long(argc, argv, "T:D:", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "rT:D:", options, NULL)) != -1) { switch (c) { case 'T': tty = optarg; @@ -67,7 +65,7 @@ main (int argc, char **argv) } filename = argv[optind]; if (filename == NULL) { - fprintf(stderr, "usage: %s \n", argv[0]); + usage(argv[0]); exit(1); } file = fopen(filename, "r"); @@ -75,17 +73,17 @@ main (int argc, char **argv) perror(filename); exit(1); } - hex = ccdbg_hex_file_read(file, filename); + hex = ao_hex_file_read(file, filename); fclose(file); if (!hex) exit (1); - image = ccdbg_hex_image_create(hex); + image = ao_hex_image_create(hex); if (!image) { fprintf(stderr, "image create failed\n"); exit (1); } - ccdbg_hex_file_free(hex); + ao_hex_file_free(hex); if (!tty) tty = cc_usbdevs_find_by_arg(device, "TIDongle"); dbg = ccdbg_open(tty); @@ -107,7 +105,7 @@ main (int argc, char **argv) } else { printf("Cannot load code to 0x%04x\n", image->address); - ccdbg_hex_image_free(image); + ao_hex_image_free(image); ccdbg_close(dbg); exit(1); }