* [PATCH] commands: i2c: Listen for CTRL-C when probing
@ 2016-11-15 14:46 Andrey Smirnov
2016-11-17 6:42 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Smirnov @ 2016-11-15 14:46 UTC (permalink / raw)
To: barebox; +Cc: Andrey Smirnov
Allow I2C bus probing to be interrupted early by sending CTRL-C. This is
usefull when calling the tool without any arguments and one of the busses
is misconfigured (waiting for 100+ failures is pretty inconvenient).
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
commands/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/i2c.c b/commands/i2c.c
index ae7f7fc..573032a 100644
--- a/commands/i2c.c
+++ b/commands/i2c.c
@@ -32,7 +32,7 @@ static void i2c_probe_range(struct i2c_adapter *adapter, int startaddr, int stop
client.adapter = adapter;
printf("probing i2c%d range 0x%02x-0x%02x: ", adapter->nr, startaddr, stopaddr);
- for (addr = startaddr; addr <= stopaddr; addr++) {
+ for (addr = startaddr; addr <= stopaddr && !ctrlc(); addr++) {
client.addr = addr;
ret = i2c_write_reg(&client, 0x00, ®, 0);
if (ret == 0)
--
2.5.5
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] commands: i2c: Listen for CTRL-C when probing
2016-11-15 14:46 [PATCH] commands: i2c: Listen for CTRL-C when probing Andrey Smirnov
@ 2016-11-17 6:42 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-11-17 6:42 UTC (permalink / raw)
To: Andrey Smirnov; +Cc: barebox
On Tue, Nov 15, 2016 at 06:46:27AM -0800, Andrey Smirnov wrote:
> Allow I2C bus probing to be interrupted early by sending CTRL-C. This is
> usefull when calling the tool without any arguments and one of the busses
> is misconfigured (waiting for 100+ failures is pretty inconvenient).
>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
> commands/i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
Sascha
>
> diff --git a/commands/i2c.c b/commands/i2c.c
> index ae7f7fc..573032a 100644
> --- a/commands/i2c.c
> +++ b/commands/i2c.c
> @@ -32,7 +32,7 @@ static void i2c_probe_range(struct i2c_adapter *adapter, int startaddr, int stop
> client.adapter = adapter;
>
> printf("probing i2c%d range 0x%02x-0x%02x: ", adapter->nr, startaddr, stopaddr);
> - for (addr = startaddr; addr <= stopaddr; addr++) {
> + for (addr = startaddr; addr <= stopaddr && !ctrlc(); addr++) {
> client.addr = addr;
> ret = i2c_write_reg(&client, 0x00, ®, 0);
> if (ret == 0)
> --
> 2.5.5
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-17 6:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 14:46 [PATCH] commands: i2c: Listen for CTRL-C when probing Andrey Smirnov
2016-11-17 6:42 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox