diff options
author | John Klug <john.klug@multitech.com> | 2020-10-27 10:37:10 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2020-10-27 10:37:10 -0500 |
commit | f96c38186b29560bf4e9eec07f9e6876178957a1 (patch) | |
tree | 942767040ce7fe37bea1e1c43585b91d09c24892 | |
parent | 733d547752e926b41a48601107abff4130c8ef07 (diff) | |
download | mts-id-eeprom-f96c38186b29560bf4e9eec07f9e6876178957a1.tar.gz mts-id-eeprom-f96c38186b29560bf4e9eec07f9e6876178957a1.tar.bz2 mts-id-eeprom-f96c38186b29560bf4e9eec07f9e6876178957a1.zip |
fix capa clear for the base-board mtcdt3
-rw-r--r-- | src/eeprom_main.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/eeprom_main.c b/src/eeprom_main.c index e0add12..8b805b3 100644 --- a/src/eeprom_main.c +++ b/src/eeprom_main.c @@ -634,6 +634,7 @@ int main(int argc, char *argv[]) { int option_index; int tmp; int fd; + int capa_clear = 0; char *in_file = NULL; char *out_file = "-"; char *out_format = "yaml"; @@ -918,7 +919,7 @@ int main(int argc, char *argv[]) { break; case CMD_OPT_CAPA_CLEAR: - memset(id_eeprom.capa, 0, sizeof(id_eeprom.capa)); + capa_clear = 1; break; case CMD_OPT_OUT_FORMAT: @@ -952,6 +953,18 @@ int main(int argc, char *argv[]) { } } +#ifdef MTCDT3B + if(base_board && capa_clear) { + memset(mtcdt3b_eeprom.capa, 0, sizeof(mtcdt3b_eeprom.capa)); + capa_clear = 0; + } +#endif + + if(capa_clear) { + memset(id_eeprom.capa, 0, sizeof(id_eeprom.capa)); + capa_clear = 0; + } + #define EEPROM_SET(eeprom,field) (strncpy(eeprom.field, field, sizeof(eeprom.field) - 1)); |