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

This commit is contained in:
Gwenhael Goavec-Merou 2022-03-20 08:27:13 +01:00
parent 648de05e6d
commit 684a4363ba
2 changed files with 3 additions and 5 deletions

View File

@ -143,8 +143,7 @@ void Efinix::program(unsigned int offset, bool unprotect_flash)
programSPI(offset, data, length, unprotect_flash);
}
bool Efinix::dumpFlash(const std::string &filename,
uint32_t base_addr, uint32_t len)
bool Efinix::dumpFlash(uint32_t base_addr, uint32_t len)
{
uint32_t timeout = 1000;
_spi->gpio_clear(_rst_pin);
@ -155,7 +154,7 @@ bool Efinix::dumpFlash(const std::string &filename,
SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose);
flash.reset();
flash.power_up();
flash.dump(filename, base_addr, len);
flash.dump(_filename, base_addr, len);
} catch (std::exception &e) {
printError("Fail");
printError(std::string(e.what()));

View File

@ -26,8 +26,7 @@ class Efinix: public Device {
~Efinix();
void program(unsigned int offset, bool unprotect_flash) override;
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 {
(void) len;
printError("protect flash not supported"); return false;}