Skip to content

Commit

Permalink
option byte support improved
Browse files Browse the repository at this point in the history
  • Loading branch information
2a17 committed Mar 11, 2021
1 parent cc9bedd commit eff18d8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/st-flash/flash_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,27 @@ int flash_get_opts(struct flash_opts* o, int ac, char** av) {

if (ac == 2) {
uint32_t addr;
result = get_integer_from_char_array(av[1], &addr);
result = get_integer_from_char_array(av[0], &addr);
if (result != 0) {
return bad_arg ("addr");
} else {
o->addr = (stm32_addr_t) addr;
}
uint32_t val;
result = get_integer_from_char_array(av[1], &val);
if (result != 0) {
return bad_arg ("val");
} else {
o->val = (uint32_t) val;
}
} else {
uint32_t val;
result = get_integer_from_char_array(av[0], &val);
if (result != 0) {
return bad_arg ("val");
} else {
o->val = (uint32_t) val;
}
}
} else if (o->area == FLASH_OPTION_BYTES_BOOT_ADD) { // expect option bytes boot address
if (ac != 1) { return invalid_args("option bytes boot_add write <value>"); }
Expand Down

0 comments on commit eff18d8

Please sign in to comment.