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
5c09690f
Commit
5c09690f
authored
Jun 16, 2012
by
Henrik Nordstrom
Browse files
fel fill command
parent
e7a7c855
Changes
1
Show whitespace changes
Inline
Side-by-side
fel.c
View file @
5c09690f
...
...
@@ -257,10 +257,10 @@ void aw_fel_dump(libusb_device_handle *usb, uint32_t offset, size_t size)
aw_fel_read
(
usb
,
offset
,
buf
,
size
);
fwrite
(
buf
,
size
,
1
,
stdout
);
}
void
aw_fel_
clear
(
libusb_device_handle
*
usb
,
uint32_t
offset
,
size_t
size
)
void
aw_fel_
fill
(
libusb_device_handle
*
usb
,
uint32_t
offset
,
size_t
size
,
unsigned
char
value
)
{
unsigned
char
buf
[
size
];
memset
(
buf
,
0
,
size
);
memset
(
buf
,
value
,
size
);
aw_fel_write
(
usb
,
buf
,
offset
,
size
);
}
...
...
@@ -279,6 +279,7 @@ int main(int argc, char **argv)
" write address file Store file contents into memory
\n
"
" ver[sion] Show BROM version
\n
"
" clear address length Clear memory
\n
"
" fill address length value Fill memory
\n
"
,
argv
[
0
]
);
}
...
...
@@ -313,8 +314,11 @@ int main(int argc, char **argv)
free
(
buf
);
skip
=
3
;
}
else
if
(
strcmp
(
argv
[
1
],
"clear"
)
==
0
&&
argc
>
2
)
{
aw_fel_
clear
(
handle
,
strtoul
(
argv
[
2
],
NULL
,
0
),
strtoul
(
argv
[
3
],
NULL
,
0
));
aw_fel_
fill
(
handle
,
strtoul
(
argv
[
2
],
NULL
,
0
),
strtoul
(
argv
[
3
],
NULL
,
0
)
,
0
);
skip
=
3
;
}
else
if
(
strcmp
(
argv
[
1
],
"fill"
)
==
0
&&
argc
>
3
)
{
aw_fel_fill
(
handle
,
strtoul
(
argv
[
2
],
NULL
,
0
),
strtoul
(
argv
[
3
],
NULL
,
0
),
(
unsigned
char
)
strtoul
(
argv
[
4
],
NULL
,
0
));
skip
=
4
;
}
else
{
fprintf
(
stderr
,
"Invalid command %s
\n
"
,
argv
[
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