main: DFU mode: pass board vid/pid

This commit is contained in:
Gwenhael Goavec-Merou 2021-07-17 08:36:32 +02:00
parent cbe2bf5494
commit 630d4428c6
1 changed files with 6 additions and 1 deletions

View File

@ -265,8 +265,13 @@ int main(int argc, char **argv)
if (args.dfu || (board && board->mode == COMM_DFU)) {
/* try to init DFU probe */
DFU *dfu = NULL;
uint16_t vid = 0, pid = 0;
if (board) {
vid = board->vid;
pid = board->pid;
}
try {
dfu = new DFU(args.bit_file, args.verbose);
dfu = new DFU(args.bit_file, vid, pid, args.verbose);
} catch (std::exception &e) {
printError("DFU init failed with: " + string(e.what()));
return EXIT_FAILURE;