Skip to content

Commit 3b918cc

Browse files
kartbendkalowsk
authored andcommitted
drivers: sensor: adopt SHELL_HELP
Adopt SHELL_HELP macro for sensor shell Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent f6f6196 commit 3b918cc

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

drivers/sensor/sensor_shell.c

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,33 @@
2121
LOG_MODULE_REGISTER(sensor_shell, CONFIG_SENSOR_LOG_LEVEL);
2222

2323
#define SENSOR_GET_HELP \
24-
"Get sensor data. Channel names are optional. All channels are read " \
25-
"when no channels are provided. Syntax:\n" \
26-
"<device_name> <channel name 0> .. <channel name N>"
24+
SHELL_HELP("Get sensor data.\n" \
25+
"Channel names are optional. All channels are read when no channels are " \
26+
"provided.", \
27+
"<device_name> [<channel name 0> .. <channel name N>]")
2728

2829
#define SENSOR_STREAM_HELP \
29-
"Start/stop streaming sensor data. Data ready trigger will be used if no triggers " \
30-
"are provided. Syntax:\n" \
31-
"<device_name> on|off <trigger name> incl|drop|nop"
30+
SHELL_HELP("Start/stop streaming sensor data.\n" \
31+
"Data ready trigger will be used if no triggers are provided.", \
32+
"<device_name> on|off <trigger name> incl|drop|nop")
3233

3334
#define SENSOR_ATTR_GET_HELP \
34-
"Get the sensor's channel attribute. Syntax:\n" \
35-
"<device_name> [<channel_name 0> <attribute_name 0> .. " \
36-
"<channel_name N> <attribute_name N>]"
35+
SHELL_HELP("Get the sensor's channel attribute.", \
36+
"<device_name> [<channel_name 0> <attribute_name 0> .. " \
37+
"<channel_name N> <attribute_name N>]")
3738

3839
#define SENSOR_ATTR_SET_HELP \
39-
"Set the sensor's channel attribute.\n" \
40-
"<device_name> <channel_name> <attribute_name> <value>"
40+
SHELL_HELP("Set the sensor's channel attribute.", \
41+
"<device_name> <channel_name> <attribute_name> <value>")
4142

42-
#define SENSOR_INFO_HELP "Get sensor info, such as vendor and model name, for all sensors."
43+
#define SENSOR_INFO_HELP \
44+
SHELL_HELP("Get sensor info, such as vendor and model name, for all sensors.", \
45+
"<device_name>")
4346

4447
#define SENSOR_TRIG_HELP \
45-
"Get or set the trigger type on a sensor. Currently only supports `data_ready`.\n" \
46-
"<device_name> <on/off> <trigger_name>"
48+
SHELL_HELP("Get or set the trigger type on a sensor.\n" \
49+
"Currently only supports `data_ready`.", \
50+
"<device_name> <on/off> <trigger_name>")
4751

4852
static const char *const sensor_channel_name[SENSOR_CHAN_COMMON_COUNT] = {
4953
[SENSOR_CHAN_ACCEL_X] = "accel_x",

0 commit comments

Comments
 (0)