mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-01 14:14:38 +02:00
upload use usb_bulk_wirte.
This commit is contained in:
parent
ca44786d0f
commit
3bcfd5725b
@ -92,7 +92,7 @@ int usb_ingenic_init(struct ingenic_dev *ingenic_dev)
|
||||
int num_ingenic, status = -1;
|
||||
|
||||
usb_init();
|
||||
// usb_set_debug(255);
|
||||
/* usb_set_debug(255); */
|
||||
usb_find_busses();
|
||||
usb_find_devices();
|
||||
|
||||
@ -193,14 +193,14 @@ int usb_ingenic_upload(struct ingenic_dev *ingenic_dev, int stage)
|
||||
fprintf(stderr, "Error - can't set the address on Ingenic device: %i\n", status);
|
||||
|
||||
/* upload the file */
|
||||
status = usb_bulk_read(ingenic_dev->usb_handle,
|
||||
/* endpoint */ INGENIC_ENDPOINT,
|
||||
status = usb_bulk_write(ingenic_dev->usb_handle,
|
||||
/* endpoint */ INGENIC_OUT_ENDPOINT,
|
||||
/* bulk data */ ingenic_dev->file_buff,
|
||||
/* bulk data length */ ingenic_dev->file_len,
|
||||
USB_TIMEOUT);
|
||||
|
||||
if (status < ingenic_dev->file_len) {
|
||||
fprintf(stderr, "Error - can't send bulk data to Ingenic CPU: %i\n", status);
|
||||
fprintf(stderr, "Error - can't send bulk data to Ingenic CPU: %i\nfile length: %d\n", status, ingenic_dev->file_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
|
||||
#define INGENIC_ENDPOINT 0x01
|
||||
#define INGENIC_OUT_ENDPOINT 0x01
|
||||
|
||||
#define VR_GET_CPU_INFO 0x00
|
||||
#define VR_SET_DATA_ADDRESS 0x01
|
||||
|
Loading…
Reference in New Issue
Block a user