From 1cec6705d178ab162a89601f43c2349d9b659597 Mon Sep 17 00:00:00 2001 From: Vineela Tummalapalli Date: Wed, 1 Feb 2017 17:06:23 -0800 Subject: [PATCH] peripheralman.c: Updating the mraa_i2c_bus_t structure for all the available i2c busses Signed-off-by: Vineela Tummalapalli Signed-off-by: Brendan Le Foll --- src/peripheralman/peripheralman.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/peripheralman/peripheralman.c b/src/peripheralman/peripheralman.c index dc09a70..47d1963 100644 --- a/src/peripheralman/peripheralman.c +++ b/src/peripheralman/peripheralman.c @@ -707,6 +707,13 @@ mraa_peripheralman_plat_init() b->pins[i].gpio.pinmap = i; } + for (i = 0; i < i2c_busses_count; i++) { + b->i2c_bus[i].bus_id = i; + b->i2c_bus[i].sda = -1; + b->i2c_bus[i].scl = -1; + } + + b->adv_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t)); if (b->adv_func == NULL) { free(b->pins);