diff --git a/README.md b/README.md index e53ea18..20d6a9f 100644 --- a/README.md +++ b/README.md @@ -406,14 +406,14 @@ Download [precompiled libusb for windows](http://sourceforge.net/projects/libusb/files/) and extract it to the libusb directory: - wget https://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.20/libusb-1.0.20.7z - 7z x -olibusb libusb-1.0.20.7z + wget https://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.22/libusb-1.0.22.7z + 7z x -olibusb libusb-1.0.22.7z Build [libftdi](http://www.intra2net.com/en/developer/libftdi/) from source: - wget http://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.2.tar.bz2 - tar xjvf libftdi1-1.2.tar.bz2 - cd libftdi1-1.2 + wget http://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.4.tar.bz2 + tar xjvf libftdi1-1.4.tar.bz2 + cd libftdi1-1.4 cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-i686-w64-mingw32.cmake \ -DLIBUSB_INCLUDE_DIR=../libusb/include/libusb-1.0 \ -DLIBUSB_LIBRARIES="-L../../libusb/MinGW32/static -lusb-1.0" \ diff --git a/VERSION b/VERSION index af31fed..85e3f94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.3-a4 +0.5.3-a5 diff --git a/spi.c b/spi.c index a8d8f6d..aecd357 100644 --- a/spi.c +++ b/spi.c @@ -551,6 +551,8 @@ int spi_set_interface(const char *intf) int spi_init(void) { + struct ftdi_version_info fv; + LOG(DEBUG, "spi_nrefs=%d, spi_dev_open=%d", spi_nrefs, spi_dev_open); spi_nrefs++; @@ -560,7 +562,10 @@ int spi_init(void) return 0; } - LOG(ALL, "csr-spi-ftdi " VERSION ", git rev " GIT_REVISION); + fv = ftdi_get_library_version(); + LOG(ALL, "csr-spi-ftdi " VERSION ", git rev " GIT_REVISION ", libftdi %s-%s", + fv.version_str, fv.snapshot_str); + if (ftdi_init(&ftdic) < 0) { SPI_ERR("FTDI: init failed"); @@ -879,6 +884,7 @@ int spi_isopen(void) #ifdef SPI_STATS void spi_output_stats(void) { + struct ftdi_version_info fv; double xfer_pct = NAN, avg_read = NAN, avg_write = NAN, rate = NAN, iops = NAN; double ftdi_rate = NAN, ftdi_xfers_per_io = NAN, avg_ftdi_xfer = NAN, ftdi_short_rate = NAN; struct timeval tv; @@ -889,6 +895,8 @@ void spi_output_stats(void) if (!fp) return; + fv = ftdi_get_library_version(); + /* Calculate timeranges until now */ if (gettimeofday(&tv, NULL) < 0) LOG(WARN, "gettimeofday failed: %s", strerror(errno)); @@ -936,6 +944,7 @@ void spi_output_stats(void) fprintf(fp, "*** FTDI Statistics ********************************************************\n" "csr-spi-ftdi version: " VERSION " (git rev " GIT_REVISION ")\n" + "libftdi version: %s-%s\n" "Time open: %ld.%02ld s\n" "Time in xfer: %ld.%02ld s (%.2f%% of open time)\n" "Reads: %ld (%ld bytes, %.2f bytes avg read size)\n" @@ -948,6 +957,7 @@ void spi_output_stats(void) " %.2f xfers/IO, %.2f bytes/xfer)\n" "SPI max clock: %lu kHz, min clock: %lu kHz, slowdowns: %lu\n" "****************************************************************************\n", + fv.version_str, fv.snapshot_str, spi_stats.tv_open.tv_sec, spi_stats.tv_open.tv_usec / 10000, spi_stats.tv_xfer.tv_sec, spi_stats.tv_xfer.tv_usec / 10000, xfer_pct, spi_stats.reads, spi_stats.read_bytes, avg_read,