From 9787c4af7b616bfd816cd78dbb9cb32a5e7379d0 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Sat, 28 Jan 2017 22:55:35 +0100 Subject: [PATCH] nrf5/i2c: Updating module to use new struct layout from hal_twi.h --- nrf5/i2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nrf5/i2c.c b/nrf5/i2c.c index 54d42e5fc3..bcbdb30641 100644 --- a/nrf5/i2c.c +++ b/nrf5/i2c.c @@ -40,8 +40,8 @@ typedef struct _machine_i2c_obj_t { TWI_HandleTypeDef *i2c; } machine_i2c_obj_t; -TWI_HandleTypeDef I2CHandle0 = {.instance = NULL, .id = 0}; -TWI_HandleTypeDef I2CHandle1 = {.instance = NULL, .id = 1}; +TWI_HandleTypeDef I2CHandle0 = {.instance = NULL, .init.id = 0}; +TWI_HandleTypeDef I2CHandle1 = {.instance = NULL, .init.id = 1}; STATIC const machine_i2c_obj_t machine_i2c_obj[] = { {{&machine_i2c_type}, &I2CHandle0}, @@ -69,7 +69,7 @@ STATIC int i2c_find(mp_obj_t id) { STATIC void i2c_print(const mp_print_t *print, mp_obj_t o, mp_print_kind_t kind) { machine_i2c_obj_t *self = o; - mp_printf(print, "I2C(%u)", self->i2c->id); + mp_printf(print, "I2C(%u)", self->i2c->init.id); } /******************************************************************************/