summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);