From cdc52413630777404eb674c995f3beb8a0168fb6 Mon Sep 17 00:00:00 2001 From: DrZiplok Date: Fri, 25 Mar 2011 02:51:03 +0000 Subject: [PATCH] Print the key associated with a variable when the variable is printed using AP_Var_menu_show. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1812 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Common/AP_Var_menufuncs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Common/AP_Var_menufuncs.cpp b/libraries/AP_Common/AP_Var_menufuncs.cpp index 0eb3563141..a2aa8dfd95 100644 --- a/libraries/AP_Common/AP_Var_menufuncs.cpp +++ b/libraries/AP_Common/AP_Var_menufuncs.cpp @@ -124,7 +124,7 @@ AP_Var_menu_show(uint8_t argc, const Menu::arg *argv) } // print name and value - Serial.printf_P(PSTR("%-32.32s: "), name_buffer); + Serial.printf_P(PSTR("%03u:%-32.32s: "), vp->key(), name_buffer); AP_Var_print(vp); Serial.println(); } @@ -132,12 +132,12 @@ AP_Var_menu_show(uint8_t argc, const Menu::arg *argv) } // show variable by name - Serial.printf_P(PSTR("%s: "), argv[1].str); vp = AP_Var::find(argv[1].str); if (NULL == vp) { Serial.println_P(PSTR("not found")); return -1; } + Serial.printf_P(PSTR("%03u:%s: "), vp->key(), argv[1].str); AP_Var_print(vp); Serial.println();