Device:
- suppress prog_mode to the constructor and set mode to NONE_MODE - parse file extension - program, idCode and reset are now virtual
This commit is contained in:
parent
52889506a5
commit
66fbbce59a
16
device.cpp
16
device.cpp
|
|
@ -5,21 +5,17 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Device::Device(FtdiJtag *jtag, enum prog_mode mode, string filename):
|
Device::Device(FtdiJtag *jtag, string filename):
|
||||||
_filename(filename), _mode(mode)
|
_filename(filename),
|
||||||
|
_file_extension(filename.substr(filename.find_last_of(".") +1)),
|
||||||
|
_mode(NONE_MODE)
|
||||||
{
|
{
|
||||||
_jtag = jtag;
|
_jtag = jtag;
|
||||||
|
cout << _file_extension << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Device::idCode()
|
Device::~Device() {}
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Device::program()
|
|
||||||
{
|
|
||||||
throw std::runtime_error("Not implemented");
|
|
||||||
}
|
|
||||||
void Device::reset()
|
void Device::reset()
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Not implemented");
|
throw std::runtime_error("Not implemented");
|
||||||
|
|
|
||||||
10
device.hpp
10
device.hpp
|
|
@ -17,13 +17,15 @@ class Device {
|
||||||
SPI_MODE,
|
SPI_MODE,
|
||||||
MEM_MODE
|
MEM_MODE
|
||||||
};
|
};
|
||||||
Device(FtdiJtag *jtag, enum prog_mode, std::string filename);
|
Device(FtdiJtag *jtag, std::string filename);
|
||||||
virtual void program();
|
virtual ~Device();
|
||||||
int idCode();
|
virtual void program(unsigned int offset = 0) = 0;
|
||||||
void reset();
|
virtual int idCode() = 0;
|
||||||
|
virtual void reset();
|
||||||
protected:
|
protected:
|
||||||
FtdiJtag *_jtag;
|
FtdiJtag *_jtag;
|
||||||
std::string _filename;
|
std::string _filename;
|
||||||
|
std::string _file_extension;
|
||||||
enum prog_mode _mode;
|
enum prog_mode _mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue