diff --git a/device.cpp b/device.cpp index 3410c44..709b1f4 100644 --- a/device.cpp +++ b/device.cpp @@ -5,13 +5,14 @@ using namespace std; -Device::Device(FtdiJtag *jtag, string filename): +Device::Device(FtdiJtag *jtag, string filename, bool verbose): _filename(filename), _file_extension(filename.substr(filename.find_last_of(".") +1)), - _mode(NONE_MODE) + _mode(NONE_MODE), _verbose(verbose) { _jtag = jtag; - cout << _file_extension << endl; + if (_verbose) + cout << "File type : " << _file_extension << endl; } Device::~Device() {} diff --git a/device.hpp b/device.hpp index e16946c..c425e03 100644 --- a/device.hpp +++ b/device.hpp @@ -18,7 +18,7 @@ class Device { FLASH_MODE = 1, MEM_MODE = 2 }; - Device(FtdiJtag *jtag, std::string filename); + Device(FtdiJtag *jtag, std::string filename, bool verbose = false); virtual ~Device(); virtual void program(unsigned int offset = 0) = 0; virtual int idCode() = 0; @@ -28,6 +28,7 @@ class Device { std::string _filename; std::string _file_extension; enum prog_mode _mode; + bool _verbose; }; #endif