main: catch exception if FPGA can't be claimed.
This commit is contained in:
parent
956d506bf7
commit
1992360667
|
|
@ -260,6 +260,7 @@ int main(int argc, char **argv)
|
|||
string fab = fpga_list[idcode].manufacturer;
|
||||
|
||||
Device *fpga;
|
||||
try {
|
||||
if (fab == "xilinx") {
|
||||
fpga = new Xilinx(jtag, args.bit_file, args.write_flash, args.write_sram,
|
||||
args.verbose);
|
||||
|
|
@ -279,6 +280,11 @@ int main(int argc, char **argv)
|
|||
delete(jtag);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
} catch (std::exception &e) {
|
||||
printError("Error: Failed to claim FPGA device");
|
||||
delete(jtag);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!args.bit_file.empty()) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue