mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-23 05:53:09 +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;
|
int num_ingenic, status = -1;
|
||||||
|
|
||||||
usb_init();
|
usb_init();
|
||||||
// usb_set_debug(255);
|
/* usb_set_debug(255); */
|
||||||
usb_find_busses();
|
usb_find_busses();
|
||||||
usb_find_devices();
|
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);
|
fprintf(stderr, "Error - can't set the address on Ingenic device: %i\n", status);
|
||||||
|
|
||||||
/* upload the file */
|
/* upload the file */
|
||||||
status = usb_bulk_read(ingenic_dev->usb_handle,
|
status = usb_bulk_write(ingenic_dev->usb_handle,
|
||||||
/* endpoint */ INGENIC_ENDPOINT,
|
/* endpoint */ INGENIC_OUT_ENDPOINT,
|
||||||
/* bulk data */ ingenic_dev->file_buff,
|
/* bulk data */ ingenic_dev->file_buff,
|
||||||
/* bulk data length */ ingenic_dev->file_len,
|
/* bulk data length */ ingenic_dev->file_len,
|
||||||
USB_TIMEOUT);
|
USB_TIMEOUT);
|
||||||
|
|
||||||
if (status < ingenic_dev->file_len) {
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define INGENIC_ENDPOINT 0x01
|
#define INGENIC_OUT_ENDPOINT 0x01
|
||||||
|
|
||||||
#define VR_GET_CPU_INFO 0x00
|
#define VR_GET_CPU_INFO 0x00
|
||||||
#define VR_SET_DATA_ADDRESS 0x01
|
#define VR_SET_DATA_ADDRESS 0x01
|
||||||
|
Loading…
Reference in New Issue
Block a user