lattice: honor verbose

This commit is contained in:
Gwenhael Goavec-Merou 2019-11-21 08:38:45 +01:00
parent f5791ca0d4
commit 8bb8f60433
2 changed files with 18 additions and 5 deletions

View File

@ -60,7 +60,8 @@ using namespace std;
# define REG_STATUS_FAIL (1 << 13)
# define REG_STATUS_EXEC_ERR (1 << 26)
Lattice::Lattice(FtdiJtag *jtag, const string filename):Device(jtag, filename)
Lattice::Lattice(FtdiJtag *jtag, const string filename, bool verbose):
Device(jtag, filename, verbose)
{
if (_filename != "")
if (_file_extension == "jed")
@ -129,11 +130,23 @@ void Lattice::program(unsigned int offset)
if (_mode != FLASH_MODE)
return;
JedParser _jed(_filename);
_jed.parse();
JedParser _jed(_filename, _verbose);
printInfo("Open file " + _filename + " ", false);
printSuccess("DONE");
if (_jed.parse() == EXIT_FAILURE) {
printInfo("Parse file ", false);
printError("FAIL");
return;
} else {
printInfo("Parse file ", false);
printSuccess("DONE");
}
/* read ID Code 0xE0 */
printf("IDCode : %x\n", idCode());
if (_verbose)
printf("IDCode : %x\n", idCode());
/* preload 0x1C */
uint8_t tx_buf[26];

View File

@ -29,7 +29,7 @@
class Lattice: public Device {
public:
Lattice(FtdiJtag *jtag, std::string filename);
Lattice(FtdiJtag *jtag, std::string filename, bool verbose);
int idCode() override;
void reset() override {}
void program(unsigned int offset) override;