lattice: if unknown file type, fails only for SRAM

This commit is contained in:
Gwenhael Goavec-Merou 2021-11-24 07:35:10 +01:00
parent 98a025d68e
commit 533cd64f37
1 changed files with 5 additions and 2 deletions

View File

@ -149,8 +149,11 @@ Lattice::Lattice(Jtag *jtag, const string filename, const string &file_type,
_mode = Device::FLASH_MODE; _mode = Device::FLASH_MODE;
else else
_mode = Device::MEM_MODE; _mode = Device::MEM_MODE;
} else { } else { /* unknown type: */
throw std::runtime_error("incompatible file format"); if (prg_type == Device::WR_FLASH) /* to flash: OK */
_mode = Device::FLASH_MODE;
else /* otherwise: KO */
throw std::runtime_error("incompatible file format");
} }
} }
/* check device family */ /* check device family */