From 8cc3247d216c354c040833f7e1eef394009be284 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 16 Mar 2021 14:43:46 +0100 Subject: [PATCH] PWM command: Switch default to status, leave info --- boards/cuav/x7pro/default.cmake | 5 ++--- src/systemcmds/pwm/pwm.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/boards/cuav/x7pro/default.cmake b/boards/cuav/x7pro/default.cmake index 47237807e8..baf2f83862 100644 --- a/boards/cuav/x7pro/default.cmake +++ b/boards/cuav/x7pro/default.cmake @@ -36,8 +36,8 @@ px4_add_board( imu/invensense/icm20689 irlock lights/rgbled - lights/rgbled_ncp5623c - lights/rgbled_pwm + #lights/rgbled_ncp5623c + #lights/rgbled_pwm magnetometer # all available magnetometer drivers optical_flow # all available optical flow drivers #osd @@ -47,7 +47,6 @@ px4_add_board( pwm_out_sim pwm_out rc_input - roboclaw safety_button telemetry # all available telemetry drivers test_ppm diff --git a/src/systemcmds/pwm/pwm.cpp b/src/systemcmds/pwm/pwm.cpp index 6ea75290ff..27dcebaad0 100644 --- a/src/systemcmds/pwm/pwm.cpp +++ b/src/systemcmds/pwm/pwm.cpp @@ -85,14 +85,14 @@ This command is used to configure PWM outputs for servo and ESC control. The default device `/dev/pwm_output0` are the Main channels, AUX channels are on `/dev/pwm_output1` (`-d` parameter). It is used in the startup script to make sure the PWM parameters (`PWM_*`) are applied (or the ones provided -by the airframe config if specified). `pwm info` shows the current settings (the trim value is an offset +by the airframe config if specified). `pwm status` shows the current settings (the trim value is an offset and configured with `PWM_MAIN_TRIMx` and `PWM_AUX_TRIMx`). The disarmed value should be set such that the motors don't spin (it's also used for the kill switch), at the minimum value they should spin. Channels are assigned to a group. Due to hardware limitations, the update rate can only be set per group. Use -`pwm info` to display the groups. If the `-c` argument is used, all channels of any included group must be included. +`pwm status` to display the groups. If the `-c` argument is used, all channels of any included group must be included. The parameters `-p` and `-r` can be set to a parameter instead of specifying an integer: use -p p:PWM_MIN for example. @@ -113,7 +113,7 @@ $ pwm test -c 13 -p 1200 PRINT_MODULE_USAGE_COMMAND_DESCR("arm", "Arm output"); PRINT_MODULE_USAGE_COMMAND_DESCR("disarm", "Disarm output"); - PRINT_MODULE_USAGE_COMMAND_DESCR("info", "Print current configuration of all channels"); + PRINT_MODULE_USAGE_COMMAND_DESCR("status", "Print current configuration of all channels"); PRINT_MODULE_USAGE_COMMAND_DESCR("forcefail", "Force Failsafe mode. " "PWM outputs are set to failsafe values."); PRINT_MODULE_USAGE_ARG("on|off", "Turn on or off", false); @@ -144,7 +144,7 @@ $ pwm test -c 13 -p 1200 PRINT_MODULE_USAGE_PARAM_STRING('c', nullptr, nullptr, "select channels in the form: 1234 (1 digit per channel, 1=first)", true); PRINT_MODULE_USAGE_PARAM_INT('m', -1, 0, 4096, "Select channels via bitmask (eg. 0xF, 3)", true); - PRINT_MODULE_USAGE_PARAM_INT('g', -1, 0, 10, "Select channels by group (eg. 0, 1, 2. use 'pwm info' to show groups)", + PRINT_MODULE_USAGE_PARAM_INT('g', -1, 0, 10, "Select channels by group (eg. 0, 1, 2. use 'pwm status' to show groups)", true); PRINT_MODULE_USAGE_PARAM_FLAG('a', "Select all channels", true); @@ -843,7 +843,7 @@ err_out_no_test: goto err_out; - } else if (!strcmp(command, "info")) { + } else if (!strcmp(command, "status") || !strcmp(command, "info")) { printf("device: %s\n", dev);