From 910e9389433220fbf95e602061ef4fc0d2133d69 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 7 Jun 2019 16:45:04 -0400 Subject: [PATCH] tune_control move usage() to bottom of file --- src/systemcmds/tune_control/tune_control.cpp | 70 ++++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/systemcmds/tune_control/tune_control.cpp b/src/systemcmds/tune_control/tune_control.cpp index 4063630c7a..0ce5f8842b 100644 --- a/src/systemcmds/tune_control/tune_control.cpp +++ b/src/systemcmds/tune_control/tune_control.cpp @@ -63,41 +63,6 @@ extern "C" { __EXPORT int tune_control_main(int argc, char *argv[]); } -static void -usage() -{ - - PRINT_MODULE_DESCRIPTION( - R"DESCR_STR( -### Description - -Command-line tool to control & test the (external) tunes. - -Tunes are used to provide audible notification and warnings (e.g. when the system arms, gets position lock, etc.). -The tool requires that a driver is running that can handle the tune_control uorb topic. - -Information about the tune format and predefined system tunes can be found here: -https://github.com/PX4/Firmware/blob/master/src/lib/tunes/tune_definition.desc - -### Examples - -Play system tune #2: -$ tune_control play -t 2 -)DESCR_STR"); - - PRINT_MODULE_USAGE_NAME("tune_control", "system"); - PRINT_MODULE_USAGE_COMMAND_DESCR("play","Play system tune or single note."); - PRINT_MODULE_USAGE_PARAM_INT('t', 1, 1, 21, "Play predefined system tune", true); - PRINT_MODULE_USAGE_PARAM_INT('f', -1, 0, 22, "Frequency of note in Hz (0-22kHz)", true); - PRINT_MODULE_USAGE_PARAM_INT('d', -1, 1, 21, "Duration of note in us", true); - PRINT_MODULE_USAGE_PARAM_INT('s', 40, 0, 100, "Volume level (loudness) of the note (0-100)", true); - PRINT_MODULE_USAGE_PARAM_STRING('m', nullptr, R"( - e.g. "MFT200e8a8a")", - "Melody in string form", true); - PRINT_MODULE_USAGE_COMMAND_DESCR("libtest","Test library"); - PRINT_MODULE_USAGE_COMMAND_DESCR("stop","Stop playback (use for repeated tunes)"); - -} - static void publish_tune_control(tune_control_s &tune_control) { tune_control.timestamp = hrt_absolute_time(); @@ -269,3 +234,38 @@ tune_control_main(int argc, char *argv[]) return 0; } + +static void +usage() +{ + + PRINT_MODULE_DESCRIPTION( + R"DESCR_STR( +### Description + +Command-line tool to control & test the (external) tunes. + +Tunes are used to provide audible notification and warnings (e.g. when the system arms, gets position lock, etc.). +The tool requires that a driver is running that can handle the tune_control uorb topic. + +Information about the tune format and predefined system tunes can be found here: +https://github.com/PX4/Firmware/blob/master/src/lib/tunes/tune_definition.desc + +### Examples + +Play system tune #2: +$ tune_control play -t 2 +)DESCR_STR"); + + PRINT_MODULE_USAGE_NAME("tune_control", "system"); + PRINT_MODULE_USAGE_COMMAND_DESCR("play","Play system tune or single note."); + PRINT_MODULE_USAGE_PARAM_INT('t', 1, 1, 21, "Play predefined system tune", true); + PRINT_MODULE_USAGE_PARAM_INT('f', -1, 0, 22, "Frequency of note in Hz (0-22kHz)", true); + PRINT_MODULE_USAGE_PARAM_INT('d', -1, 1, 21, "Duration of note in us", true); + PRINT_MODULE_USAGE_PARAM_INT('s', 40, 0, 100, "Volume level (loudness) of the note (0-100)", true); + PRINT_MODULE_USAGE_PARAM_STRING('m', nullptr, R"( - e.g. "MFT200e8a8a")", + "Melody in string form", true); + PRINT_MODULE_USAGE_COMMAND_DESCR("libtest","Test library"); + PRINT_MODULE_USAGE_COMMAND_DESCR("stop","Stop playback (use for repeated tunes)"); + +}