From 3a88c44620e13e42819173100a358540770136f8 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 26 Apr 2016 10:59:26 +0100 Subject: [PATCH] i2c.c: rollback change to mraa_i2c_init that stopped default bus being used Partly rollsback f2c4d95c15ad8bb17646799102d8cad8e0e27fa1 which stopped mraa_i2c_init from switching i2c bus silently. If you don't want this to happen, you need to use mraa_i2c_init_raw. Closes #497. Signed-off-by: Brendan Le Foll --- src/i2c/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i2c/i2c.c b/src/i2c/i2c.c index 9dab088..85b0172 100644 --- a/src/i2c/i2c.c +++ b/src/i2c/i2c.c @@ -159,8 +159,8 @@ mraa_i2c_init(int bus) } if (board->i2c_bus[bus].bus_id == -1) { - syslog(LOG_ERR, "i2c%i_init: Invalid i2c bus", bus); - return NULL; + syslog(LOG_ERR, "Invalid i2c bus %i, moving to default i2c bus %i", bus, board->def_i2c_bus); + bus = board->def_i2c_bus; } if (!board->no_bus_mux) { int pos = board->i2c_bus[bus].sda;