From 8b7c1d80cb92ea4b64abfd04107e7a3bb022fafe Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Wed, 22 Oct 2014 20:51:13 +0100 Subject: [PATCH] intel_edison_fab_c.c: If i2c bus number is invalid use the default bus (6) Signed-off-by: Brendan Le Foll --- src/intel_edison_fab_c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intel_edison_fab_c.c b/src/intel_edison_fab_c.c index 84d734c..f40adbc 100644 --- a/src/intel_edison_fab_c.c +++ b/src/intel_edison_fab_c.c @@ -129,8 +129,8 @@ mraa_intel_edison_i2c_init_pre(unsigned int bus) { if (miniboard == 0) { if(bus != 6) { - syslog(LOG_ERR, "Edison: You can't use that bus :/"); - return MRAA_ERROR_INVALID_RESOURCE; + syslog(LOG_ERR, "Edison: You can't use that bus, switching to bus 6"); + bus = 6; } mraa_gpio_write(tristate, 0); mraa_gpio_context io18_gpio = mraa_gpio_init_raw(14); @@ -162,8 +162,8 @@ mraa_intel_edison_i2c_init_pre(unsigned int bus) mraa_gpio_write(tristate, 1); } else { if(bus != 6 && bus != 1) { - syslog(LOG_ERR, "Edison: You can't use that bus :/"); - return MRAA_ERROR_INVALID_RESOURCE; + syslog(LOG_ERR, "Edison: You can't use that bus, switching to bus 6"); + bus = 6; } int scl = plat->pins[plat->i2c_bus[bus].scl].gpio.pinmap; int sda = plat->pins[plat->i2c_bus[bus].sda].gpio.pinmap;