mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
param: also show unused params for 'param show -c'
I find this generally useful for debugging.
This commit is contained in:
@@ -137,7 +137,7 @@ $ reboot
|
|||||||
|
|
||||||
PRINT_MODULE_USAGE_COMMAND_DESCR("show", "Show parameter values");
|
PRINT_MODULE_USAGE_COMMAND_DESCR("show", "Show parameter values");
|
||||||
PRINT_MODULE_USAGE_PARAM_FLAG('a', "Show all parameters (not just used)", 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('c', "Show only changed params (unused too)", true);
|
||||||
PRINT_MODULE_USAGE_PARAM_FLAG('q', "quiet mode, print only param value (name needs to be exact)", 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);
|
PRINT_MODULE_USAGE_ARG("<filter>", "Filter by param name (wildcard at end allowed, eg. sys_*)", true);
|
||||||
|
|
||||||
@@ -457,7 +457,8 @@ static int
|
|||||||
do_show(const char *search_string, bool only_changed)
|
do_show(const char *search_string, bool only_changed)
|
||||||
{
|
{
|
||||||
PARAM_PRINT("Symbols: x = used, + = saved, * = unsaved\n");
|
PARAM_PRINT("Symbols: x = used, + = saved, * = unsaved\n");
|
||||||
param_foreach(do_show_print, (char *)search_string, only_changed, true);
|
// also show unused params if we show non-default values only
|
||||||
|
param_foreach(do_show_print, (char *)search_string, only_changed, !only_changed);
|
||||||
PARAM_PRINT("\n %u/%u parameters used.\n", param_count_used(), param_count());
|
PARAM_PRINT("\n %u/%u parameters used.\n", param_count_used(), param_count());
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user