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
e4a13abd
Commit
e4a13abd
authored
Jun 24, 2012
by
Henrik Nordstrom
Browse files
Merge branch 'master' of github.com:amery/sunxi-tools
parents
acd46ea6
e85fecf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
e4a13abd
fexc
fexc
bin2fex
bin2fex
fex2bin
fex2bin
fel
*.o
*.o
*.swp
*.swp
fel.c
View file @
e4a13abd
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <endian.h>
#include <endian.h>
#include <errno.h>
int
errno
;
struct
aw_usb_request
{
struct
aw_usb_request
{
char
signature
[
8
];
char
signature
[
8
];
...
@@ -50,6 +53,7 @@ void usb_bulk_send(libusb_device_handle *usb, int ep, const void *data, int leng
...
@@ -50,6 +53,7 @@ void usb_bulk_send(libusb_device_handle *usb, int ep, const void *data, int leng
while
(
length
>
0
)
{
while
(
length
>
0
)
{
rc
=
libusb_bulk_transfer
(
usb
,
ep
,
(
void
*
)
data
,
length
,
&
sent
,
1000
);
rc
=
libusb_bulk_transfer
(
usb
,
ep
,
(
void
*
)
data
,
length
,
&
sent
,
1000
);
if
(
rc
!=
0
)
{
if
(
rc
!=
0
)
{
errno
=
EIO
;
perror
(
"usb send"
);
perror
(
"usb send"
);
exit
(
2
);
exit
(
2
);
}
}
...
@@ -64,6 +68,7 @@ void usb_bulk_recv(libusb_device_handle *usb, int ep, void *data, int length)
...
@@ -64,6 +68,7 @@ void usb_bulk_recv(libusb_device_handle *usb, int ep, void *data, int length)
while
(
length
>
0
)
{
while
(
length
>
0
)
{
rc
=
libusb_bulk_transfer
(
usb
,
ep
,
data
,
length
,
&
recv
,
1000
);
rc
=
libusb_bulk_transfer
(
usb
,
ep
,
data
,
length
,
&
recv
,
1000
);
if
(
rc
!=
0
)
{
if
(
rc
!=
0
)
{
errno
=
EIO
;
perror
(
"usb recv"
);
perror
(
"usb recv"
);
exit
(
2
);
exit
(
2
);
}
}
...
@@ -286,6 +291,7 @@ int main(int argc, char **argv)
...
@@ -286,6 +291,7 @@ int main(int argc, char **argv)
handle
=
libusb_open_device_with_vid_pid
(
NULL
,
0x1f3a
,
0xefe8
);
handle
=
libusb_open_device_with_vid_pid
(
NULL
,
0x1f3a
,
0xefe8
);
if
(
!
handle
)
{
if
(
!
handle
)
{
errno
=
ENODEV
;
perror
(
"A10 USB FEL device not found!"
);
perror
(
"A10 USB FEL device not found!"
);
exit
(
1
);
exit
(
1
);
}
}
...
...
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