From e6782114364a00d83512f02ff894f2db6c84091e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Aug 2018 10:33:32 -0600 Subject: [PATCH] system/i2c/i2c_main.c: fix a backward comparison. Noted by Jakob Haufe. --- system/i2c/README.txt | 2 +- system/i2c/i2c_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/i2c/README.txt b/system/i2c/README.txt index b6073ed12..7fc71da3b 100644 --- a/system/i2c/README.txt +++ b/system/i2c/README.txt @@ -207,7 +207,7 @@ List buses: bus [OPTIONS] This command will simply list all of the configured I2C buses and indicate which are supported by the driver and which are not: - BUS EXISTS? + BUS EXISTS? Bus 1: YES Bus 2: NO diff --git a/system/i2c/i2c_main.c b/system/i2c/i2c_main.c index 21c6866d9..3475c09c7 100644 --- a/system/i2c/i2c_main.c +++ b/system/i2c/i2c_main.c @@ -365,7 +365,7 @@ int i2c_main(int argc, char *argv[]) g_i2ctool.addr = CONFIG_I2CTOOL_MINADDR; } - if (g_i2ctool.regaddr < CONFIG_I2CTOOL_MAXREGADDR) + if (g_i2ctool.regaddr > CONFIG_I2CTOOL_MAXREGADDR) { g_i2ctool.regaddr = 0; }