From 684a4363ba9cada7d32547f69558ec113a40cb90 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sun, 20 Mar 2022 08:27:13 +0100 Subject: [PATCH] efinix: fix dumpFlash: add override, remove filename param and use _filename from constructor --- src/efinix.cpp | 5 ++--- src/efinix.hpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/efinix.cpp b/src/efinix.cpp index c096e3b..1182ff1 100644 --- a/src/efinix.cpp +++ b/src/efinix.cpp @@ -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(_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())); diff --git a/src/efinix.hpp b/src/efinix.hpp index 7948735..fafe7cc 100644 --- a/src/efinix.hpp +++ b/src/efinix.hpp @@ -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;}