Skip to content

Commit

Permalink
astyle: removed raw string literal from PRINT_MODULE_DESCRIPTION() so…
Browse files Browse the repository at this point in the history
… astlye will work
  • Loading branch information
BazookaJoe1900 committed Jan 18, 2025
1 parent 1eb9434 commit 6349ba1
Show file tree
Hide file tree
Showing 134 changed files with 1,835 additions and 1,950 deletions.
3 changes: 1 addition & 2 deletions Tools/px4moduledoc/srcparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ def documentation(self):

# convert '$ cmd' commands into code blocks (e.g. '$ logger start')
# use lookahead (?=...) so the multiple consecutive command lines work
doc_string = re.sub(r"\n\$ (.*)(?=\n)", r"\n```\n\1\n```", doc_string)
# now merge consecutive blocks
doc_string = re.sub(r"(?m)^\$ (.*)", r"```\n\1\n```", doc_string)
doc_string = re.sub(r"\n```\n```\n", r"\n", doc_string)

return doc_string
Expand Down
7 changes: 2 additions & 5 deletions boards/emlid/navio2/navio_rgbled/NavioRGBLed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,8 @@ int NavioRGBLed::print_usage(const char *reason)
}

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
Emlid Navio2 RGB LED driver.
)DESCR_STR");
"### Description\n"
"Emlid Navio2 RGB LED driver.");

PRINT_MODULE_USAGE_NAME("navio_rgbled", "driver");
PRINT_MODULE_USAGE_COMMAND("start");
Expand Down
7 changes: 2 additions & 5 deletions boards/modalai/voxl2-slpi/src/drivers/ghst_rc/ghst_rc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,8 @@ int GhstRc::print_usage(const char *reason)
}

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
This module parses the GHST RC uplink protocol and can generate GHST downlink telemetry data
)DESCR_STR");
"### Description\n"
"This module parses the GHST RC uplink protocol and can generate GHST downlink telemetry data");

PRINT_MODULE_USAGE_NAME("ghst_rc", "driver");
PRINT_MODULE_USAGE_COMMAND("start");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,8 @@ int VoxlSaveCalParams::print_usage(const char *reason)
}

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
This implements autosaving of calibration parameters on VOXL2 platform.
)DESCR_STR");
"### Description\n"
"This implements autosaving of calibration parameters on VOXL2 platform.");

PRINT_MODULE_USAGE_COMMAND("start");
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
Expand Down
84 changes: 48 additions & 36 deletions src/drivers/actuators/voxl_esc/voxl_esc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,18 +1469,15 @@ int VoxlEsc::print_usage(const char *reason)
}

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
This module is responsible for...
### Implementation
By default the module runs on a work queue with a callback on the uORB actuator_controls topic.
### Examples
It is typically started with:
$ todo
)DESCR_STR");
"### Description\n"
"This module is responsible for...\n"
"\n"
"### Implementation\n"
"By default the module runs on a work queue with a callback on the uORB actuator_controls topic.\n"
"\n"
"### Examples\n"
"It is typically started with:\n"
"$ todo");

PRINT_MODULE_USAGE_NAME("voxl_esc", "driver");
PRINT_MODULE_USAGE_COMMAND_DESCR("start", "Start the task");
Expand All @@ -1497,14 +1494,16 @@ It is typically started with:
PRINT_MODULE_USAGE_COMMAND_DESCR("rpm", "Closed-Loop RPM test control request");
PRINT_MODULE_USAGE_PARAM_INT('i', 0, 0, 3, "ESC ID, 0-3", false);
PRINT_MODULE_USAGE_PARAM_INT('r', 0, -32768, 32768, "RPM, -32,768 to 32,768", false);
PRINT_MODULE_USAGE_PARAM_INT('n', 100, 0, 1<<31, "Command repeat count, 0 to INT_MAX", false);
PRINT_MODULE_USAGE_PARAM_INT('t', 10000, 0, 1<<31, "Delay between repeated commands (microseconds), 0 to INT_MAX", false);
PRINT_MODULE_USAGE_PARAM_INT('n', 100, 0, 1 << 31, "Command repeat count, 0 to INT_MAX", false);
PRINT_MODULE_USAGE_PARAM_INT('t', 10000, 0, 1 << 31, "Delay between repeated commands (microseconds), 0 to INT_MAX",
false);

PRINT_MODULE_USAGE_COMMAND_DESCR("pwm", "Open-Loop PWM test control request");
PRINT_MODULE_USAGE_PARAM_INT('i', 0, 0, 3, "ESC ID, 0-3", false);
PRINT_MODULE_USAGE_PARAM_INT('r', 0, 0, 800, "Duty Cycle value, 0 to 800", false);
PRINT_MODULE_USAGE_PARAM_INT('n', 100, 0, 1<<31, "Command repeat count, 0 to INT_MAX", false);
PRINT_MODULE_USAGE_PARAM_INT('t', 10000, 0, 1<<31, "Delay between repeated commands (microseconds), 0 to INT_MAX", false);
PRINT_MODULE_USAGE_PARAM_INT('n', 100, 0, 1 << 31, "Command repeat count, 0 to INT_MAX", false);
PRINT_MODULE_USAGE_PARAM_INT('t', 10000, 0, 1 << 31, "Delay between repeated commands (microseconds), 0 to INT_MAX",
false);

PRINT_MODULE_USAGE_COMMAND_DESCR("tone", "Send tone generation request to ESC");
PRINT_MODULE_USAGE_PARAM_INT('i', 0, 0, 3, "ESC ID, 0-3", false);
Expand All @@ -1513,7 +1512,8 @@ It is typically started with:
PRINT_MODULE_USAGE_PARAM_INT('v', 0, 0, 100, "Power (volume) of sound, 0-100", false);

PRINT_MODULE_USAGE_COMMAND_DESCR("led", "Send LED control request");
PRINT_MODULE_USAGE_PARAM_INT('l', 0, 0, 4095, "Bitmask 0x0FFF (12 bits) - ESC0 (RGB) ESC1 (RGB) ESC2 (RGB) ESC3 (RGB)", false);
PRINT_MODULE_USAGE_PARAM_INT('l', 0, 0, 4095, "Bitmask 0x0FFF (12 bits) - ESC0 (RGB) ESC1 (RGB) ESC2 (RGB) ESC3 (RGB)",
false);

PRINT_MODULE_USAGE_DEFAULT_COMMANDS();

Expand Down Expand Up @@ -1542,12 +1542,12 @@ void VoxlEsc::print_params()
PX4_INFO("Params: VOXL_ESC_T_PERC: %" PRId32, _parameters.turtle_motor_percent);
PX4_INFO("Params: VOXL_ESC_T_DEAD: %" PRId32, _parameters.turtle_motor_deadband);
PX4_INFO("Params: VOXL_ESC_T_EXPO: %" PRId32, _parameters.turtle_motor_expo);
PX4_INFO("Params: VOXL_ESC_T_MINF: %f", (double)_parameters.turtle_stick_minf);
PX4_INFO("Params: VOXL_ESC_T_COSP: %f", (double)_parameters.turtle_cosphi);
PX4_INFO("Params: VOXL_ESC_T_MINF: %f", (double)_parameters.turtle_stick_minf);
PX4_INFO("Params: VOXL_ESC_T_COSP: %f", (double)_parameters.turtle_cosphi);

PX4_INFO("Params: VOXL_ESC_VLOG: %" PRId32, _parameters.verbose_logging);
PX4_INFO("Params: VOXL_ESC_PUB_BST: %" PRId32, _parameters.publish_battery_status);

PX4_INFO("Params: VOXL_ESC_T_WARN: %" PRId32, _parameters.esc_warn_temp_threshold);
PX4_INFO("Params: VOXL_ESC_T_OVER: %" PRId32, _parameters.esc_over_temp_threshold);
}
Expand All @@ -1563,7 +1563,7 @@ int VoxlEsc::print_status()
print_params();
PX4_INFO("");

for( int i = 0; i < VOXL_ESC_OUTPUT_CHANNELS; i++){
for (int i = 0; i < VOXL_ESC_OUTPUT_CHANNELS; i++) {
PX4_INFO("-- ID: %i", i);
PX4_INFO(" Motor: %i", _output_map[i].number);
PX4_INFO(" Direction: %i", _output_map[i].direction);
Expand All @@ -1583,22 +1583,34 @@ int VoxlEsc::print_status()
return 0;
}

const char * VoxlEsc::board_id_to_name(int board_id)
const char *VoxlEsc::board_id_to_name(int board_id)
{
switch(board_id){
case 31: return "ModalAi 4-in-1 ESC V2 RevB (M0049)";
case 32: return "Blheli32 4-in-1 ESC Type A (Tmotor F55A PRO F051)";
case 33: return "Blheli32 4-in-1 ESC Type B (Tmotor F55A PRO G071)";
case 34: return "ModalAi 4-in-1 ESC (M0117-1)";
case 35: return "ModalAi I/O Expander (M0065)";
case 36: return "ModalAi 4-in-1 ESC (M0117-3)";
case 37: return "ModalAi 4-in-1 ESC (M0134-1)";
case 38: return "ModalAi 4-in-1 ESC (M0134-3)";
case 39: return "ModalAi 4-in-1 ESC (M0129-1)";
case 40: return "ModalAi 4-in-1 ESC (M0129-3)";
case 41: return "ModalAi 4-in-1 ESC (M0134-6)";
case 42: return "ModalAi 4-in-1 ESC (M0138-1)";
default: return "Unknown Board";
switch (board_id) {
case 31: return "ModalAi 4-in-1 ESC V2 RevB (M0049)";

case 32: return "Blheli32 4-in-1 ESC Type A (Tmotor F55A PRO F051)";

case 33: return "Blheli32 4-in-1 ESC Type B (Tmotor F55A PRO G071)";

case 34: return "ModalAi 4-in-1 ESC (M0117-1)";

case 35: return "ModalAi I/O Expander (M0065)";

case 36: return "ModalAi 4-in-1 ESC (M0117-3)";

case 37: return "ModalAi 4-in-1 ESC (M0134-1)";

case 38: return "ModalAi 4-in-1 ESC (M0134-3)";

case 39: return "ModalAi 4-in-1 ESC (M0129-1)";

case 40: return "ModalAi 4-in-1 ESC (M0129-3)";

case 41: return "ModalAi 4-in-1 ESC (M0134-6)";

case 42: return "ModalAi 4-in-1 ESC (M0138-1)";

default: return "Unknown Board";
}
}

Expand Down
27 changes: 12 additions & 15 deletions src/drivers/adc/ads1115/ads1115_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,19 @@ void ADS1115::print_usage()
{

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
"### Description\n"
"\n"
"Driver to enable an external [ADS1115](https://www.adafruit.com/product/1085) ADC connected via I2C.\n"
"\n"
"The driver is included by default in firmware for boards that do not have an internal analog to digital converter,\n"
"such as [PilotPi](../flight_controller/raspberry_pi_pilotpi.md) or [CUAV Nora](../flight_controller/cuav_nora.md)\n"
"(search for `CONFIG_DRIVERS_ADC_ADS1115` in board configuration files).\n"
"\n"
"It is enabled/disabled using the\n"
"[ADC_ADS1115_EN](../advanced_config/parameter_reference.md#ADC_ADS1115_EN)\n"
"parameter, and is disabled by default.\n"
"If enabled, internal ADCs are not used.");

Driver to enable an external [ADS1115](https://www.adafruit.com/product/1085) ADC connected via I2C.
The driver is included by default in firmware for boards that do not have an internal analog to digital converter,
such as [PilotPi](../flight_controller/raspberry_pi_pilotpi.md) or [CUAV Nora](../flight_controller/cuav_nora.md)
(search for `CONFIG_DRIVERS_ADC_ADS1115` in board configuration files).
It is enabled/disabled using the
[ADC_ADS1115_EN](../advanced_config/parameter_reference.md#ADC_ADS1115_EN)
parameter, and is disabled by default.
If enabled, internal ADCs are not used.
)DESCR_STR");

PRINT_MODULE_USAGE_NAME("ads1115", "driver");
PRINT_MODULE_USAGE_COMMAND("start");
PRINT_MODULE_USAGE_PARAMS_I2C_SPI_DRIVER(true, false);
Expand Down
7 changes: 2 additions & 5 deletions src/drivers/adc/board_adc/ADC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,8 @@ int ADC::print_usage(const char *reason)
}

PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
ADC driver.
)DESCR_STR");
"### Description\n"
"ADC driver.");

PRINT_MODULE_USAGE_NAME("adc", "driver");
PRINT_MODULE_USAGE_COMMAND("start");
Expand Down
Loading

0 comments on commit 6349ba1

Please sign in to comment.