colognechip: fix dumpFlash: add override, remove filename param and use _filename from constructor

This commit is contained in:
Gwenhael Goavec-Merou 2022-03-20 08:25:51 +01:00
parent 74790c40b6
commit 648de05e6d
2 changed files with 3 additions and 4 deletions

View File

@ -118,8 +118,7 @@ void CologneChip::waitCfgDone()
/** /**
* Dump flash contents to file. Works in both SPI and JTAG-SPI-bypass mode. * Dump flash contents to file. Works in both SPI and JTAG-SPI-bypass mode.
*/ */
bool CologneChip::dumpFlash(const std::string &filename, uint32_t base_addr, bool CologneChip::dumpFlash(uint32_t base_addr, uint32_t len)
uint32_t len)
{ {
if (_spi) { if (_spi) {
/* enable output and hold reset */ /* enable output and hold reset */
@ -142,7 +141,7 @@ bool CologneChip::dumpFlash(const std::string &filename, uint32_t base_addr,
} }
flash->reset(); flash->reset();
flash->power_up(); flash->power_up();
flash->dump(filename, base_addr, len); flash->dump(_filename, base_addr, len);
} catch (std::exception &e) { } catch (std::exception &e) {
printError("Fail"); printError("Fail");
printError(std::string(e.what())); printError(std::string(e.what()));

View File

@ -34,7 +34,7 @@ class CologneChip: public Device, SPIInterface {
bool cfgDone(); bool cfgDone();
void waitCfgDone(); void waitCfgDone();
bool dumpFlash(const std::string &filename, uint32_t base_addr, uint32_t len); bool dumpFlash(uint32_t base_addr, uint32_t len) override;
virtual bool protect_flash(uint32_t len) override { virtual bool protect_flash(uint32_t len) override {
(void) len; (void) len;
printError("protect flash not supported"); return false;} printError("protect flash not supported"); return false;}