diff --git a/src/avrdude.1 b/src/avrdude.1 index 7f186c35..05d656fa 100644 --- a/src/avrdude.1 +++ b/src/avrdude.1 @@ -736,14 +736,17 @@ fuse bit settings. hexadecimal; each value will get the string .Em 0x prepended. +Only valid on output. .It Ar o octal; each value will get a .Em 0 prepended unless it is less than 8 in which case it gets no prefix. +Only valid on output. .It Ar b binary; each value will get the string .Em 0b prepended. +Only valid on output. .El .Pp The default is to use auto detection for input files, and raw binary diff --git a/src/doc/avrdude.texi b/src/doc/avrdude.texi index aad5ae34..a9242b4d 100644 --- a/src/doc/avrdude.texi +++ b/src/doc/avrdude.texi @@ -809,13 +809,16 @@ fuse bit settings. @item h hexadecimal; each value will get the string @emph{0x} prepended. +Only valid on output. @item o octal; each value will get a @emph{0} prepended unless it is less than 8 in which case it gets no prefix. +Only valid on output. @item b binary; each value will get the string @emph{0b} prepended. +Only valid on output. @end table diff --git a/src/fileio.c b/src/fileio.c index f1df1158..d21d8993 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1157,6 +1157,13 @@ static int fileio_imm(struct fioparms * fio, rc = loc; } break; + + case FIO_WRITE: + avrdude_message(MSG_INFO, + "%s: Invalid file format 'immediate' for output\n", + progname); + return -1; + default: avrdude_message(MSG_INFO, "%s: fileio: invalid operation=%d\n", progname, fio->op); @@ -1271,27 +1278,32 @@ static int fileio_num(struct fioparms * fio, FILEFMT fmt) { const char *prefix; + const char *name; char cbuf[20]; int base, i, num; switch (fmt) { case FMT_HEX: + name = "hex"; prefix = "0x"; base = 16; break; default: case FMT_DEC: + name = "decimal"; prefix = ""; base = 10; break; case FMT_OCT: + name = "octal"; prefix = "0"; base = 8; break; case FMT_BIN: + name = "binary"; prefix = "0b"; base = 2; break; @@ -1301,6 +1313,13 @@ static int fileio_num(struct fioparms * fio, switch (fio->op) { case FIO_WRITE: break; + + case FIO_READ: + avrdude_message(MSG_INFO, + "%s: Invalid file format '%s' for input\n", + progname, name); + return -1; + default: avrdude_message(MSG_INFO, "%s: fileio: invalid operation=%d\n", progname, fio->op); diff --git a/src/update.c b/src/update.c index 025bfb6b..33ce0608 100644 --- a/src/update.c +++ b/src/update.c @@ -354,6 +354,7 @@ int do_op(PROGRAMMER * pgm, struct avrpart * p, UPDATE * upd, enum updateflags f progname, mem->desc, alias_mem_desc); report_progress(0, 1, "Reading"); + rc = avr_read(pgm, p, upd->memtype, 0); report_progress(1, 1, NULL); if (rc < 0) {