OpenCores
URL https://opencores.org/ocsvn/usb_fpga_1_2/usb_fpga_1_2/trunk

Subversion Repositories usb_fpga_1_2

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /usb_fpga_1_2/trunk/examples/all/ucecho
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

/UCEcho.java
33,7 → 33,7
" -d <number> Device Number (default: 0)\n" +
" -f Force uploads\n" +
" -p Print bus info\n" +
" -w Enable certain workarounds which may be required for vmware + windows\n"+
" -w Enable certain workarounds\n"+
" -h This help" );
public ParameterException (String msg) {
48,7 → 48,7
 
// ******* UCEcho **************************************************************
// constructor
public UCEcho ( ZtexDevice1 pDev ) throws UsbException, ZtexDescriptorException {
public UCEcho ( ZtexDevice1 pDev ) throws UsbException {
super ( pDev );
}
 
71,7 → 71,7
// writes a string to Endpoint 4, reads it back from Endpoint 2 and writes the output to System.out
public void echo ( String input ) throws UsbException {
byte buf[] = input.getBytes();
int i = LibusbJava.usb_bulk_write(handle, 0x04, buf, buf.length, 1000);
int i = LibusbJava.usb_bulk_write(handle(), 0x04, buf, buf.length, 1000);
if ( i<0 )
throw new UsbException("Error sending data: " + LibusbJava.usb_strerror());
System.out.println("Send "+i+" bytes: `"+input+"'" );
83,7 → 83,7
}
 
buf = new byte[1024];
i = LibusbJava.usb_bulk_read(handle, 0x82, buf, 1024, 1000);
i = LibusbJava.usb_bulk_read(handle(), 0x82, buf, 1024, 1000);
if ( i<0 )
throw new UsbException("Error receiving data: " + LibusbJava.usb_strerror());
System.out.println("Read "+i+" bytes: `"+new String(buf,0,i)+"'" );

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.