From 035a3de9dd6c0d4f0b0375b2a2c6d6315f6f1a59 Mon Sep 17 00:00:00 2001 From: schlaepfer Date: Thu, 10 Nov 2005 07:31:26 +0000 Subject: [PATCH] - parameter renamed - print hex instead of decimal git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@38 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c --- mcdp/src/ch/ntb/mcdp/bdi/BDI555.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mcdp/src/ch/ntb/mcdp/bdi/BDI555.java b/mcdp/src/ch/ntb/mcdp/bdi/BDI555.java index 0d00dcf..21be45d 100644 --- a/mcdp/src/ch/ntb/mcdp/bdi/BDI555.java +++ b/mcdp/src/ch/ntb/mcdp/bdi/BDI555.java @@ -151,7 +151,7 @@ public class BDI555 { DataPacket data = Dispatch.readBDI(); if (data.subtype == STYPE_BDI_UNKNOWN_STYPE) { throw new BDIException("unknown subtype: " + data.subtype); - }else if (data.subtype == STYPE_BDI_ERROR_TIMEOUT) { + } else if (data.subtype == STYPE_BDI_ERROR_TIMEOUT) { // receive invalid packet Dispatch.readBDI(); throw new BDIException("timeout error (DSDO not low)"); @@ -380,32 +380,32 @@ public class BDI555 { * * @param downloadData * Data to be downloaded (32 bit wide) - * @param nofWords - * Number of words + * @param dataLength + * Length of the data to download (words) * @throws BDIException * @throws DispatchException * @throws USBException */ - public static void fastDownload(int[] downloadData, int nofWords) + public static void fastDownload(int[] downloadData, int dataLength) throws BDIException, USBException, DispatchException { if (!fastDownloadStarted) { throw new BDIException("start fast download first"); } // check if data fits into USB-packet - if (nofWords > MAX_NOF_WORDS_FAST_DOWNLOAD) { + if (dataLength > MAX_NOF_WORDS_FAST_DOWNLOAD) { throw new BDIException( "data larger than MAX_NOF_WORDS_FAST_DOWNLOAD"); } int currentIndex = 0; - initPacket(STYPE_BDI_35FD_DATA, nofWords * BDI_DATA35_LENGTH); - while (currentIndex < nofWords) { + initPacket(STYPE_BDI_35FD_DATA, dataLength * BDI_DATA35_LENGTH); + while (currentIndex < dataLength) { fillPacket(false, true, downloadData[currentIndex], currentIndex * BDI_DATA35_LENGTH); currentIndex++; } - DataPacket data = transmit(nofWords * BDI_DATA35_LENGTH); + DataPacket data = transmit(dataLength * BDI_DATA35_LENGTH); if (data == null) { throw new BDIException("no data from device"); } @@ -429,7 +429,7 @@ public class BDI555 { // stop fast download int result = transferAndParse35(true, true, 0x86000000); - System.out.println("stopFastDownload:" + result); + System.out.println("stopFastDownload: result: 0x" + Integer.toHexString(result)); // if (result != 0x5F) { // // TODO: change exception string // throw new BDIException("result != 0x5F: " + result);