diff --git a/src/usbBlaster.cpp b/src/usbBlaster.cpp index c3809b0..4721101 100644 --- a/src/usbBlaster.cpp +++ b/src/usbBlaster.cpp @@ -9,13 +9,13 @@ #include #include -#include #include +#include #include "display.hpp" -#include "usbBlaster.hpp" #include "ftdipp_mpsse.hpp" #include "fx2_ll.hpp" +#include "usbBlaster.hpp" using namespace std; @@ -39,7 +39,7 @@ using namespace std; UsbBlaster::UsbBlaster(const cable_t &cable, const std::string &firmware_path, int8_t verbose): - _verbose(verbose>1), _nb_bit(0), + _verbose(verbose > 1), _nb_bit(0), _curr_tms(0), _buffer_size(64) { if (cable.pid == 0x6001) @@ -211,7 +211,7 @@ int UsbBlaster::writeTDI(uint8_t *tx, uint8_t *rx, uint32_t len, bool end) int num_read = _nb_bit; if (writeBit((rx)? rx_ptr:NULL, num_read/2) < 0) return -EXIT_FAILURE; - if (rx) // realign bits + if (rx) // realign bits *rx_ptr >>= (8 - nb_bit); } @@ -223,7 +223,7 @@ int UsbBlaster::writeTDI(uint8_t *tx, uint8_t *rx, uint32_t len, bool end) mask |= _tdi_pin; _in_buf[_nb_bit++] = mask; _in_buf[_nb_bit++] = mask | mode | _tck_pin; - uint8_t tmp; + uint8_t tmp = 0; if (writeBit((rx)? &tmp:NULL, 1) < 0) return -EXIT_FAILURE; if (rx) diff --git a/src/usbBlaster.hpp b/src/usbBlaster.hpp index 423ae98..a3b2b52 100644 --- a/src/usbBlaster.hpp +++ b/src/usbBlaster.hpp @@ -3,17 +3,17 @@ * Copyright (C) 2020 Gwenhael Goavec-Merou */ -#ifndef USBBLASTER_H -#define USBBLASTER_H +#ifndef SRC_USBBLASTER_HPP_ +#define SRC_USBBLASTER_HPP_ #include #include #include #include #include "cable.hpp" -#include "jtagInterface.hpp" #include "ftdipp_mpsse.hpp" #include "fx2_ll.hpp" +#include "jtagInterface.hpp" /*! * \file UsbBlaster.hpp @@ -111,11 +111,7 @@ class UsbBlasterI: public UsbBlaster_ll { int write(uint8_t *wr_buf, int wr_len, uint8_t *rd_buf, int rd_len) override; private: - /* - * \brief init and configure FT245 - */ - void init_internal(); - struct ftdi_context *_ftdi; /*!< ftid_context */ + struct ftdi_context *_ftdi; /*!< ftdi_context */ }; /*! @@ -136,4 +132,4 @@ class UsbBlasterII: public UsbBlaster_ll { private: FX2_ll *fx2; }; -#endif +#endif // SRC_USBBLASTER_HPP_