From 6bfb344a808081aaaf883b7576699e05d9a86882 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 29 Mar 2017 16:09:46 +1100 Subject: [PATCH] cc3200/mods/pybi2c: Raise OSError if readfrom_mem fails to write addr. --- cc3200/mods/pybi2c.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc3200/mods/pybi2c.c b/cc3200/mods/pybi2c.c index 658b2bfcd2..a6009cb772 100644 --- a/cc3200/mods/pybi2c.c +++ b/cc3200/mods/pybi2c.c @@ -278,6 +278,8 @@ STATIC void pyb_i2c_readmem_into (mp_arg_val_t *args, vstr_t *vstr) { if (!pyb_i2c_read (i2c_addr, (byte *)vstr->buf, vstr->len)) { mp_raise_OSError(MP_EIO); } + } else { + mp_raise_OSError(MP_EIO); } }