From 51f527d845c33fb9584b49d15f3fd35d13ae71d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 23 Apr 2021 11:21:17 +0200 Subject: [PATCH] param: update 'param show-for-airframe' to use set-default --- src/systemcmds/param/param.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/systemcmds/param/param.cpp b/src/systemcmds/param/param.cpp index 1bacd6706b..ff9328541e 100644 --- a/src/systemcmds/param/param.cpp +++ b/src/systemcmds/param/param.cpp @@ -514,10 +514,12 @@ do_show(const char *search_string, bool only_changed) static int do_show_for_airframe() { - PARAM_PRINT("if [ $AUTOCNF = yes ]\n"); - PARAM_PRINT("then\n"); param_foreach(do_show_print_for_airframe, nullptr, true, true); - PARAM_PRINT("fi\n"); + int32_t sys_autostart = 0; + param_get(param_find("SYS_AUTOSTART"), &sys_autostart); + if (sys_autostart != 0) { + PARAM_PRINT("# Make sure to add all params from the current airframe (ID=%i) as well\n", sys_autostart); + } return 0; } @@ -725,7 +727,7 @@ do_show_print_for_airframe(void *arg, param_t param) int32_t i; float f; - PARAM_PRINT("\tparam set %s ", p_name); + PARAM_PRINT("param set-default %s ", p_name); switch (param_type(param)) { case PARAM_TYPE_INT32: