Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
291a80c6
Unverified
Commit
291a80c6
authored
6 years ago
by
cladmi
Committed by
Gaëtan Harter
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
openocd.sh: refactor splitting banks in a separate function
Prepare for other refactoring.
parent
365d82ed
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dist/tools/openocd/openocd.sh
+15
-1
15 additions, 1 deletion
dist/tools/openocd/openocd.sh
with
15 additions
and
1 deletion
dist/tools/openocd/openocd.sh
+
15
−
1
View file @
291a80c6
...
@@ -159,6 +159,20 @@ _is_binfile() {
...
@@ -159,6 +159,20 @@ _is_binfile() {
[[ -z "
${
firmware_type
}
" ]] && _has_bin_extension "
${
firmware
}
"; }
[[ -z "
${
firmware_type
}
" ]] && _has_bin_extension "
${
firmware
}
"; }
}
}
# Split bank info on different lines without the '{}'
_split_banks() {
# Input:
# ...
# {name nrf51 base 0 size 0 bus_width 1 chip_width 1} {name nrf51 base 268439552 size 0 bus_width 1 chip_width 1}
# ...
#
# Output:
# name nrf51 base 0 size 0 bus_width 1 chip_width 1
# name nrf51 base 268439552 size 0 bus_width 1 chip_width 1
sed -n '/^{.*}
$/
{s/
\}
/
\}\n
/g;s/[{}]//g;p}'
}
# Outputs bank info on different lines without the '{}'
# Outputs bank info on different lines without the '{}'
_flash_list() {
_flash_list() {
# Openocd output for 'flash list' is
# Openocd output for 'flash list' is
...
@@ -169,7 +183,7 @@ _flash_list() {
...
@@ -169,7 +183,7 @@ _flash_list() {
${
OPENOCD_ADAPTER_INIT
}
\
${
OPENOCD_ADAPTER_INIT
}
\
-f
'${OPENOCD_CONFIG}'
\
-f
'${OPENOCD_CONFIG}'
\
-c
'flash list'
\
-c
'flash list'
\
-c
'shutdown'
" 2>&1 |
sed -n '/^{.*}
$/
{s/
\}
/
\}\n
/g;s/[{}]//g;p}'
-c
'shutdown'
" 2>&1 |
_split_banks
}
}
# Print flash address for 'bank_num' num defaults to 1
# Print flash address for 'bank_num' num defaults to 1
...
...
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