diff options
author | Nikolaus Voss <nv@vosn.de> | 2019-02-11 11:30:52 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-02-11 12:34:13 +0100 |
commit | f81e0120f4478c58e126bcadb19b9954ed184e8f (patch) | |
tree | 4b55de0ef93e564494f4b6763203cd4001150cd0 | |
parent | 61052d1bb8fe5da745c4333a8bf7d031d636b76e (diff) | |
download | busybox-w32-f81e0120f4478c58e126bcadb19b9954ed184e8f.tar.gz busybox-w32-f81e0120f4478c58e126bcadb19b9954ed184e8f.tar.bz2 busybox-w32-f81e0120f4478c58e126bcadb19b9954ed184e8f.zip |
i2c_tools.c: i2ctransfer
Call i2c_set_slave_addr() unconditionally as busy checking
is skipped depending on force argument.
Clarify usage texts for -f and -a flags.
Signed-off-by: Nikolaus Voss <nv@vosn.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | miscutils/i2c_tools.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index 455ff028d..7a2e8534a 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c | |||
@@ -1406,8 +1406,8 @@ static void check_i2c_func(int fd) | |||
1406 | //usage:#define i2ctransfer_full_usage "\n\n" | 1406 | //usage:#define i2ctransfer_full_usage "\n\n" |
1407 | //usage: "Read/write I2C data in one transfer" | 1407 | //usage: "Read/write I2C data in one transfer" |
1408 | //usage: "\n" | 1408 | //usage: "\n" |
1409 | //usage: "\n -f Force access" | 1409 | //usage: "\n -f Force access to busy addresses" |
1410 | //usage: "\n -a Force scanning of non-regular addresses" | 1410 | //usage: "\n -a Force access to non-regular addresses" |
1411 | //usage: "\n -y Disable interactive mode" | 1411 | //usage: "\n -y Disable interactive mode" |
1412 | int i2ctransfer_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1412 | int i2ctransfer_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
1413 | int i2ctransfer_main(int argc UNUSED_PARAM, char **argv) | 1413 | int i2ctransfer_main(int argc UNUSED_PARAM, char **argv) |
@@ -1467,9 +1467,7 @@ int i2ctransfer_main(int argc UNUSED_PARAM, char **argv) | |||
1467 | len = xstrtou_range(arg_ptr, 0, 0, 0xffff); | 1467 | len = xstrtou_range(arg_ptr, 0, 0, 0xffff); |
1468 | if (end) { | 1468 | if (end) { |
1469 | bus_addr = xstrtou_range(end + 1, 0, first, last); | 1469 | bus_addr = xstrtou_range(end + 1, 0, first, last); |
1470 | //TODO: will this work correctly if -f is specified? | 1470 | i2c_set_slave_addr(fd, bus_addr, (opts & opt_f)); |
1471 | if (!(opts & opt_f)) | ||
1472 | i2c_set_slave_addr(fd, bus_addr, (opts & opt_f)); | ||
1473 | } else { | 1471 | } else { |
1474 | /* Reuse last address if possible */ | 1472 | /* Reuse last address if possible */ |
1475 | if (bus_addr < 0) | 1473 | if (bus_addr < 0) |