sensor: shell: Show the error code when reading fails
The error code may give a clue as to what is wrong. Add it to the error message. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
122d8fa6a9
commit
9b8c04401d
1 changed files with 1 additions and 1 deletions
|
@ -129,7 +129,7 @@ static int cmd_get_sensor(const struct shell *shell, size_t argc, char *argv[])
|
|||
|
||||
err = sensor_sample_fetch(dev);
|
||||
if (err < 0) {
|
||||
shell_error(shell, "Failed to read sensor");
|
||||
shell_error(shell, "Failed to read sensor: %d", err);
|
||||
}
|
||||
|
||||
if (argc == 2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue