From 3bcfd5725baa67f810841b573f7f0106ba88a602 Mon Sep 17 00:00:00 2001 From: xiangfu Date: Sun, 26 Apr 2009 20:08:14 +0000 Subject: [PATCH] upload use usb_bulk_wirte. --- flash-tool/usb.c | 8 ++++---- flash-tool/usb.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flash-tool/usb.c b/flash-tool/usb.c index 3ea7e4a..cbcad23 100644 --- a/flash-tool/usb.c +++ b/flash-tool/usb.c @@ -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; } diff --git a/flash-tool/usb.h b/flash-tool/usb.h index c8bf6b5..03b5e4d 100644 --- a/flash-tool/usb.h +++ b/flash-tool/usb.h @@ -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