summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2012-08-22 12:05:17 -0500
committerJesse Gilles <jgilles@multitech.com>2012-08-22 12:05:17 -0500
commitef93b42172a2dc1d656d449a8c10af078e465e88 (patch)
treeb39095e8b38af7496a8238a6bfa65c14e464d110 /src
parentcba3133ea50f1a14ab5b85504104271c623fa26b (diff)
downloadmts-id-eeprom-ef93b42172a2dc1d656d449a8c10af078e465e88.tar.gz
mts-id-eeprom-ef93b42172a2dc1d656d449a8c10af078e465e88.tar.bz2
mts-id-eeprom-ef93b42172a2dc1d656d449a8c10af078e465e88.zip
force bin format for updating in place
Diffstat (limited to 'src')
-rw-r--r--src/eeprom_main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/eeprom_main.c b/src/eeprom_main.c
index 7ffd31a..6262062 100644
--- a/src/eeprom_main.c
+++ b/src/eeprom_main.c
@@ -310,6 +310,7 @@ int main(int argc, char *argv[]) {
char *in_file = NULL;
char *out_file = "-";
char *out_format = "yaml";
+ int update = 0;
struct mts_id_eeprom_layout id_eeprom;
@@ -365,7 +366,7 @@ int main(int argc, char *argv[]) {
break;
case CMD_OPT_UPDATE:
- out_file = in_file;
+ update = 1;
break;
case CMD_OPT_OUT_FILE:
out_file = optarg;
@@ -473,6 +474,12 @@ int main(int argc, char *argv[]) {
}
}
+ // updating eeprom in place, force bin format
+ if (update) {
+ out_file = in_file;
+ out_format = "bin";
+ }
+
if (out_file) {
if (!strcmp(out_format, "bin")) {
bin_out(out_file, &id_eeprom);