Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM astyle: removed raw string literal from PRINT_MODULE_DESCRIPTION for full scan of file of astyle #24154

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/systemcmds/actuator_test/actuator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ static void usage(const char *reason)
}

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
Utility to test actuators.

WARNING: remove all props before using this command.
)DESCR_STR");
"Utility to test actuators.\n"
"\n"
"WARNING: remove all props before using this command.\n");

PRINT_MODULE_USAGE_NAME("actuator_test", "command");
PRINT_MODULE_USAGE_COMMAND_DESCR("set", "Set an actuator to a specific output value");
Expand Down Expand Up @@ -122,6 +120,7 @@ int actuator_test_main(int argc, char *argv[])
usage("value invalid");
return 1;
}

break;

case 't':
Expand Down Expand Up @@ -162,27 +161,33 @@ int actuator_test_main(int argc, char *argv[])
}

actuator_test(function, NAN, 0, true);

} else {
actuator_test(function, value, timeout_ms, false);
}

return 0;

} else if (strcmp("iterate-motors", argv[myoptind]) == 0) {
value = 0.15f;

for (int i = 0; i < actuator_test_s::MAX_NUM_MOTORS; ++i) {
PX4_INFO("Motor %i (%.0f%%)", i, (double)(value*100.f));
actuator_test(actuator_test_s::FUNCTION_MOTOR1+i, value, 400, false);
PX4_INFO("Motor %i (%.0f%%)", i, (double)(value * 100.f));
actuator_test(actuator_test_s::FUNCTION_MOTOR1 + i, value, 400, false);
px4_usleep(600000);
}

return 0;

} else if (strcmp("iterate-servos", argv[myoptind]) == 0) {
value = 0.3f;

for (int i = 0; i < actuator_test_s::MAX_NUM_SERVOS; ++i) {
PX4_INFO("Servo %i (%.0f%%)", i, (double)(value*100.f));
actuator_test(actuator_test_s::FUNCTION_SERVO1+i, value, 800, false);
PX4_INFO("Servo %i (%.0f%%)", i, (double)(value * 100.f));
actuator_test(actuator_test_s::FUNCTION_SERVO1 + i, value, 800, false);
px4_usleep(1000000);
}

return 0;
}
}
Expand Down
29 changes: 15 additions & 14 deletions src/systemcmds/failure/failure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,16 @@ static constexpr FailureType failure_types[] = {
static void print_usage()
{
PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
Inject failures into system.

### Implementation
This system command sends a vehicle command over uORB to trigger failure.

### Examples
Test the GPS failsafe by stopping GPS:

failure gps off
)DESCR_STR");
"### Description\n"
"Inject failures into system.\n"
"\n"
"### Implementation\n"
"This system command sends a vehicle command over uORB to trigger failure.\n"
"\n"
"### Examples\n"
"Test the GPS failsafe by stopping GPS:\n"
"\n"
"failure gps off");

PRINT_MODULE_USAGE_NAME_SIMPLE("failure", "command");
PRINT_MODULE_USAGE_COMMAND_DESCR("help", "Show this help text");
Expand All @@ -108,19 +106,22 @@ failure gps off
PRINT_MODULE_USAGE_PARAM_INT('i', 0, 0, 4, "sensor instance (0=all)", true);

PX4_INFO_RAW("\nComponents:\n");

for (const auto &failure_unit : failure_units) {
PX4_INFO_RAW("- %s\n", failure_unit.key);
}

PX4_INFO_RAW("\nFailure types:\n");

for (const auto &failure_type : failure_types) {
PX4_INFO_RAW("- %s\n", failure_type.key);
}
}

int inject_failure(const FailureUnit& unit, const FailureType& type, uint8_t instance)
int inject_failure(const FailureUnit &unit, const FailureType &type, uint8_t instance)
{
PX4_WARN("inject failure unit: %s (%d), type: %s (%d), instance: %d", unit.key, unit.value, type.key, type.value, instance);
PX4_WARN("inject failure unit: %s (%d), type: %s (%d), instance: %d", unit.key, unit.value, type.key, type.value,
instance);

uORB::Subscription command_ack_sub{ORB_ID(vehicle_command_ack)};

Expand Down
10 changes: 4 additions & 6 deletions src/systemcmds/i2c_launcher/i2c_launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,9 @@ int I2CLauncher::print_usage(const char *reason)
}

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
Daemon that starts drivers based on found I2C devices.

)DESCR_STR");
"### Description\n"
"Daemon that starts drivers based on found I2C devices.\n"
"\n");

PRINT_MODULE_USAGE_NAME("i2c_launcher", "system");
PRINT_MODULE_USAGE_COMMAND("start");
Expand All @@ -213,7 +211,7 @@ extern "C" __EXPORT int i2c_launcher_main(int argc, char *argv[])
{
using ThisDriver = I2CLauncher;

static I2CLauncher* instances[I2C_BUS_MAX_BUS_ITEMS];
static I2CLauncher *instances[I2C_BUS_MAX_BUS_ITEMS];
int bus = -1;
int myoptind = 1;
int ch;
Expand Down
Loading