Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
F
fernly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Craig Comstock
fernly
Commits
a02ae82f
Commit
a02ae82f
authored
Apr 02, 2015
by
Sean Cross
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pfalcon-loader-wait'
parents
005e2d67
6020a924
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
5 deletions
+28
-5
fernly-usb-loader.c
fernly-usb-loader.c
+28
-5
No files found.
fernly-usb-loader.c
View file @
a02ae82f
...
...
@@ -1203,6 +1203,7 @@ static void print_help(const char *name)
printf
(
"
\n
"
);
printf
(
"Arguments:
\n
"
);
printf
(
" -l [logfile] Log boot output to the specified file
\n
"
);
printf
(
" -w Wait for serial port to appear
\n
"
);
printf
(
" -s Enter boot shell
\n
"
);
printf
(
" -h Print this help
\n
"
);
printf
(
"
\n
"
);
...
...
@@ -1222,8 +1223,9 @@ int main(int argc, char **argv) {
uint32_t
ret
;
int
opt
;
int
shell
=
0
;
int
wait_serial
=
0
;
while
((
opt
=
getopt
(
argc
,
argv
,
"hl:s"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"hl:s
w
"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'l'
:
...
...
@@ -1234,6 +1236,10 @@ int main(int argc, char **argv) {
shell
=
1
;
break
;
case
'w'
:
wait_serial
=
1
;
break
;
default:
case
'h'
:
print_help
(
argv
[
0
]);
...
...
@@ -1251,10 +1257,27 @@ int main(int argc, char **argv) {
exit
(
1
);
}
serfd
=
open
(
argv
[
1
],
O_RDWR
);
if
(
-
1
==
serfd
)
{
perror
(
"Unable to open serial port"
);
exit
(
1
);
if
(
wait_serial
)
{
printf
(
"Waiting for serial port to connect: ."
);
fflush
(
stdout
);
}
while
(
1
)
{
serfd
=
open
(
argv
[
1
],
O_RDWR
);
if
(
-
1
==
serfd
)
{
if
(
wait_serial
)
{
printf
(
"."
);
fflush
(
stdout
);
sleep
(
1
);
continue
;
}
else
{
perror
(
"Unable to open serial port"
);
exit
(
1
);
}
}
break
;
}
if
(
wait_serial
)
{
printf
(
"
\n
"
);
}
s1blfd
=
open
(
argv
[
2
],
O_RDONLY
);
...
...
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