mirror of
https://github.com/trabucayre/openFPGALoader.git
synced 2026-08-31 02:07:14 +02:00
pass cable_t instead of mpsse_bit_config
This commit is contained in:
+4
-4
@@ -63,7 +63,7 @@ using namespace std;
|
||||
* - envoyer le dernier avec 0x4B ou 0x6B
|
||||
*/
|
||||
|
||||
Jtag::Jtag(FTDIpp_MPSSE::mpsse_bit_config &cable, string dev,
|
||||
Jtag::Jtag(cable_t &cable, string dev,
|
||||
uint32_t clkHZ, bool verbose):
|
||||
_verbose(verbose),
|
||||
_state(RUN_TEST_IDLE),
|
||||
@@ -73,7 +73,7 @@ Jtag::Jtag(FTDIpp_MPSSE::mpsse_bit_config &cable, string dev,
|
||||
init_internal(cable, clkHZ);
|
||||
}
|
||||
|
||||
Jtag::Jtag(FTDIpp_MPSSE::mpsse_bit_config &cable, uint32_t clkHZ, bool verbose):
|
||||
Jtag::Jtag(cable_t &cable, uint32_t clkHZ, bool verbose):
|
||||
_verbose(verbose),
|
||||
_state(RUN_TEST_IDLE),
|
||||
_tms_buffer_size(128), _num_tms(0),
|
||||
@@ -88,9 +88,9 @@ Jtag::~Jtag()
|
||||
delete _jtag;
|
||||
}
|
||||
|
||||
void Jtag::init_internal(FTDIpp_MPSSE::mpsse_bit_config &cable, uint32_t clkHZ)
|
||||
void Jtag::init_internal(cable_t &cable, uint32_t clkHZ)
|
||||
{
|
||||
_jtag = new FtdiJtagMPSSE(cable, clkHZ, _verbose);
|
||||
_jtag = new FtdiJtagMPSSE(cable.config, clkHZ, _verbose);
|
||||
|
||||
_tms_buffer = (unsigned char *)malloc(sizeof(unsigned char) * _tms_buffer_size);
|
||||
bzero(_tms_buffer, _tms_buffer_size);
|
||||
|
||||
+4
-3
@@ -22,14 +22,15 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cable.hpp"
|
||||
#include "ftdipp_mpsse.hpp"
|
||||
#include "jtagInterface.hpp"
|
||||
|
||||
class Jtag {
|
||||
public:
|
||||
Jtag(FTDIpp_MPSSE::mpsse_bit_config &cable, std::string dev,
|
||||
Jtag(cable_t &cable, std::string dev,
|
||||
uint32_t clkHZ, bool verbose = false);
|
||||
Jtag(FTDIpp_MPSSE::mpsse_bit_config &cable,
|
||||
Jtag(cable_t &cable,
|
||||
uint32_t clkHZ, bool verbose);
|
||||
~Jtag();
|
||||
|
||||
@@ -80,7 +81,7 @@ class Jtag {
|
||||
void setVerbose(bool verbose){_verbose = verbose;}
|
||||
|
||||
private:
|
||||
void init_internal(FTDIpp_MPSSE::mpsse_bit_config &cable, uint32_t clkHZ);
|
||||
void init_internal(cable_t &cable, uint32_t clkHZ);
|
||||
bool _verbose;
|
||||
int _state;
|
||||
int _tms_buffer_size;
|
||||
|
||||
+2
-2
@@ -85,7 +85,7 @@ void displaySupported(const struct arguments &args);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FTDIpp_MPSSE::mpsse_bit_config cable;
|
||||
cable_t cable;
|
||||
|
||||
/* command line args. */
|
||||
struct arguments args = {false, false, false, 0, "", "-", "-", "-",
|
||||
@@ -267,7 +267,7 @@ void displaySupported(const struct arguments &args)
|
||||
t << setw(15) << left << "cable name:" << "vid:pid";
|
||||
printSuccess(t.str());
|
||||
for (auto b = cable_list.begin(); b != cable_list.end(); b++) {
|
||||
FTDIpp_MPSSE::mpsse_bit_config c = (*b).second;
|
||||
FTDIpp_MPSSE::mpsse_bit_config c = (*b).second.config;
|
||||
stringstream ss;
|
||||
ss << setw(15) << left << (*b).first;
|
||||
ss << "0x" << hex << c.vid << ":" << c.pid;
|
||||
|
||||
Reference in New Issue
Block a user