Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
openocd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
openocd
Commits
6e542407
Commit
6e542407
authored
15 years ago
by
Zachary T Welch
Browse files
Options
Downloads
Patches
Plain Diff
Improve pld command argument parsing.
parent
2b78a4e8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pld/pld.c
+8
-5
8 additions, 5 deletions
src/pld/pld.c
src/pld/virtex2.c
+3
-1
3 additions, 1 deletion
src/pld/virtex2.c
with
11 additions
and
6 deletions
src/pld/pld.c
+
8
−
5
View file @
6e542407
...
...
@@ -175,7 +175,9 @@ static int handle_pld_load_command(struct command_context_s *cmd_ctx,
return
ERROR_OK
;
}
p
=
get_pld_device_by_num
(
strtoul
(
args
[
0
],
NULL
,
0
));
unsigned
dev_id
;
COMMAND_PARSE_NUMBER
(
uint
,
args
[
0
],
dev_id
);
p
=
get_pld_device_by_num
(
dev_id
);
if
(
!
p
)
{
command_print
(
cmd_ctx
,
"pld device '#%s' is out of bounds"
,
args
[
0
]);
...
...
@@ -184,19 +186,20 @@ static int handle_pld_load_command(struct command_context_s *cmd_ctx,
if
((
retval
=
p
->
driver
->
load
(
p
,
args
[
1
]))
!=
ERROR_OK
)
{
command_print
(
cmd_ctx
,
"failed loading file %s to pld device %
l
u"
,
args
[
1
],
strtoul
(
args
[
0
],
NULL
,
0
)
);
command_print
(
cmd_ctx
,
"failed loading file %s to pld device %u"
,
args
[
1
],
dev_id
);
switch
(
retval
)
{
}
return
retval
;
}
else
{
gettimeofday
(
&
end
,
NULL
);
timeval_subtract
(
&
duration
,
&
end
,
&
start
);
command_print
(
cmd_ctx
,
"loaded file %s to pld device %
l
u in %jis %jius"
,
args
[
1
],
strtoul
(
args
[
0
],
NULL
,
0
)
,
command_print
(
cmd_ctx
,
"loaded file %s to pld device %u in %jis %jius"
,
args
[
1
],
dev_id
,
(
intmax_t
)
duration
.
tv_sec
,
(
intmax_t
)
duration
.
tv_usec
);
}
...
...
This diff is collapsed.
Click to expand it.
src/pld/virtex2.c
+
3
−
1
View file @
6e542407
...
...
@@ -202,7 +202,9 @@ static int virtex2_handle_read_stat_command(struct command_context_s *cmd_ctx,
return
ERROR_OK
;
}
device
=
get_pld_device_by_num
(
strtoul
(
args
[
0
],
NULL
,
0
));
unsigned
dev_id
;
COMMAND_PARSE_NUMBER
(
uint
,
args
[
0
],
dev_id
);
device
=
get_pld_device_by_num
(
dev_id
);
if
(
!
device
)
{
command_print
(
cmd_ctx
,
"pld device '#%s' is out of bounds"
,
args
[
0
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment