Skip to content
Commit e4c83ab5 authored by Diego Rondini's avatar Diego Rondini Committed by Tom Rini
Browse files

cmd: gpio: Add `gpio read` subcommand



As explained in commit 4af2a33e ("cmd: gpio: Make `gpio input`
return pin value again") the `gpio input` is used in scripts to obtain
the value of a pin, despite the fact that CMD_RET_FAILURE is
indistinguishable from a valid pin value.
To be able to detect failures and properly use the value of a GPIO in
scripts we introduce the `gpio read` command that sets the variable
`name` to the value of the pin. Return code of the `gpio read` command
can be used to check for CMD_RET_SUCCESS or CMD_RET_FAILURE.

Signed-off-by: default avatarDiego Rondini <diego.rondini@kynetics.com>
parent bd2a6164
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment