Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Alberto Ruiz Garcia
Firmware
Commits
84724d5e
Commit
84724d5e
authored
6 years ago
by
Daniel Agar
Browse files
Options
Downloads
Patches
Plain Diff
param show default only active parameters
- add -a option to display all possible system parameters
parent
1ded189f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib/parameters/param.h
+1
-1
1 addition, 1 deletion
src/lib/parameters/param.h
src/systemcmds/param/param.cpp
+18
-2
18 additions, 2 deletions
src/systemcmds/param/param.cpp
with
19 additions
and
3 deletions
src/lib/parameters/param.h
+
1
−
1
View file @
84724d5e
...
...
@@ -349,7 +349,7 @@ __EXPORT int param_load(int fd);
* @param arg Argument passed to the function.
* @param only_changed If true, the function is only called for parameters whose values have
* been changed from the default.
* @param only_
chang
ed If true, the function is only called for parameters which have been
* @param only_
us
ed If true, the function is only called for parameters which have been
* used in one of the running applications.
*/
__EXPORT
void
param_foreach
(
void
(
*
func
)(
void
*
arg
,
param_t
param
),
void
*
arg
,
bool
only_changed
,
bool
only_used
);
...
...
This diff is collapsed.
Click to expand it.
src/systemcmds/param/param.cpp
+
18
−
2
View file @
84724d5e
...
...
@@ -81,6 +81,7 @@ static int do_save_default();
static
int
do_load
(
const
char
*
param_file_name
);
static
int
do_import
(
const
char
*
param_file_name
);
static
int
do_show
(
const
char
*
search_string
,
bool
only_changed
);
static
int
do_show_all
();
static
int
do_show_quiet
(
const
char
*
param_name
);
static
int
do_show_index
(
const
char
*
index
,
bool
used_index
);
static
void
do_show_print
(
void
*
arg
,
param_t
param
);
...
...
@@ -130,7 +131,8 @@ $ reboot
PRINT_MODULE_USAGE_ARG
(
"<file>"
,
"File name (use <root>/eeprom/parameters if not given)"
,
true
);
PRINT_MODULE_USAGE_COMMAND_DESCR
(
"show"
,
"Show parameter values"
);
PRINT_MODULE_USAGE_PARAM_FLAG
(
'c'
,
"Show only changed params"
,
true
);
PRINT_MODULE_USAGE_PARAM_FLAG
(
'a'
,
"Show all parameters (not just used)"
,
true
);
PRINT_MODULE_USAGE_PARAM_FLAG
(
'c'
,
"Show only changed and used params"
,
true
);
PRINT_MODULE_USAGE_PARAM_FLAG
(
'q'
,
"quiet mode, print only param value (name needs to be exact)"
,
true
);
PRINT_MODULE_USAGE_ARG
(
"<filter>"
,
"Filter by param name (wildcard at end allowed, eg. sys_*)"
,
true
);
...
...
@@ -227,6 +229,9 @@ param_main(int argc, char *argv[])
return
do_show
(
nullptr
,
true
);
}
}
else
if
(
!
strcmp
(
argv
[
2
],
"-a"
))
{
return
do_show_all
();
}
else
if
(
!
strcmp
(
argv
[
2
],
"-q"
))
{
if
(
argc
>=
4
)
{
return
do_show_quiet
(
argv
[
3
]);
...
...
@@ -426,11 +431,22 @@ static int
do_show
(
const
char
*
search_string
,
bool
only_changed
)
{
PARAM_PRINT
(
"Symbols: x = used, + = saved, * = unsaved
\n
"
);
param_foreach
(
do_show_print
,
(
char
*
)
search_string
,
only_changed
,
false
);
param_foreach
(
do_show_print
,
(
char
*
)
search_string
,
only_changed
,
true
);
PARAM_PRINT
(
"
\n
%u/%u parameters used.
\n
"
,
param_count_used
(),
param_count
());
return
0
;
}
static
int
do_show_all
()
{
PARAM_PRINT
(
"Symbols: x = used, + = saved, * = unsaved
\n
"
);
param_foreach
(
do_show_print
,
nullptr
,
false
,
false
);
PARAM_PRINT
(
"
\n
%u parameters total, %u used.
\n
"
,
param_count
(),
param_count_used
());
return
0
;
}
static
int
do_show_quiet
(
const
char
*
param_name
)
{
...
...
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