From ab35ac41a590ca42a08484bbe254e0e4e027c99d Mon Sep 17 00:00:00 2001 From: Grant Morphett Date: Fri, 28 Aug 2015 18:28:26 +1000 Subject: [PATCH] AP_Param: Add parameter to print out all the keys/indexes For some debugging I was working on I needed to see all the token indexs and group elements. --- libraries/AP_Param/AP_Param.cpp | 5 ++++- libraries/AP_Param/AP_Param.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Param/AP_Param.cpp b/libraries/AP_Param/AP_Param.cpp index 21a848609c..aecb4caff1 100644 --- a/libraries/AP_Param/AP_Param.cpp +++ b/libraries/AP_Param/AP_Param.cpp @@ -1114,7 +1114,7 @@ void AP_Param::show(const AP_Param *ap, const ParamToken &token, } // print the value of all variables -void AP_Param::show_all(AP_HAL::BetterStream *port) +void AP_Param::show_all(AP_HAL::BetterStream *port, bool showKeyValues) { ParamToken token; AP_Param *ap; @@ -1123,6 +1123,9 @@ void AP_Param::show_all(AP_HAL::BetterStream *port) for (ap=AP_Param::first(&token, &type); ap; ap=AP_Param::next_scalar(&token, &type)) { + if (showKeyValues) { + port->printf_P(PSTR("Key %i: Index %i: GroupElement %i : "), token.key, token.idx, token.group_element); + } show(ap, token, type, port); } } diff --git a/libraries/AP_Param/AP_Param.h b/libraries/AP_Param/AP_Param.h index f682a074c3..bb3bb58357 100644 --- a/libraries/AP_Param/AP_Param.h +++ b/libraries/AP_Param/AP_Param.h @@ -224,7 +224,7 @@ public: static void erase_all(void); /// print the value of all variables - static void show_all(AP_HAL::BetterStream *port); + static void show_all(AP_HAL::BetterStream *port, bool showKeyValues=false); /// print the value of one variable static void show(const AP_Param *param,