Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
d4a8dd80
Commit
d4a8dd80
authored
Aug 15, 2012
by
Henrik Nordstrom
Browse files
fel: Improve error reporting a bit
parent
17fb268e
Changes
1
Hide whitespace changes
Inline
Side-by-side
fel.c
View file @
d4a8dd80
...
...
@@ -27,12 +27,9 @@
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "endian_compat.h"
int
errno
;
struct
aw_usb_request
{
char
signature
[
8
];
uint32_t
length
;
...
...
@@ -55,8 +52,7 @@ void usb_bulk_send(libusb_device_handle *usb, int ep, const void *data, int leng
while
(
length
>
0
)
{
rc
=
libusb_bulk_transfer
(
usb
,
ep
,
(
void
*
)
data
,
length
,
&
sent
,
timeout
);
if
(
rc
!=
0
)
{
errno
=
EIO
;
perror
(
"usb send"
);
fprintf
(
stderr
,
"libusb usb_bulk_send error %d
\n
"
,
rc
);
exit
(
2
);
}
length
-=
sent
;
...
...
@@ -70,8 +66,7 @@ void usb_bulk_recv(libusb_device_handle *usb, int ep, void *data, int length)
while
(
length
>
0
)
{
rc
=
libusb_bulk_transfer
(
usb
,
ep
,
data
,
length
,
&
recv
,
timeout
);
if
(
rc
!=
0
)
{
errno
=
EIO
;
perror
(
"usb recv"
);
fprintf
(
stderr
,
"usb_bulk_recv error %d
\n
"
,
rc
);
exit
(
2
);
}
length
-=
recv
;
...
...
@@ -283,8 +278,7 @@ int main(int argc, char **argv)
handle
=
libusb_open_device_with_vid_pid
(
NULL
,
0x1f3a
,
0xefe8
);
if
(
!
handle
)
{
errno
=
ENODEV
;
perror
(
"A10 USB FEL device not found!"
);
fprintf
(
stderr
,
"A10 USB FEL device not found!"
);
exit
(
1
);
}
rc
=
libusb_claim_interface
(
handle
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment