X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fpcf8574.c;h=5572e40ce3ce29803315fa3bfc3b45d541d7f8ed;hb=ec1f9b136d8b9ec44272ba7ab8ddc4b729589af2;hp=71150427c05cf64d66cae6ceab758304fb9ab646;hpb=b90e284547eab472e3d9e478a058304bdd6b2da7;p=bertos.git diff --git a/bertos/drv/pcf8574.c b/bertos/drv/pcf8574.c index 71150427..5572e40c 100644 --- a/bertos/drv/pcf8574.c +++ b/bertos/drv/pcf8574.c @@ -40,7 +40,6 @@ * each pin as input or output, see datasheet on how this * is achieved. * - * \version $Id$ * \author Francesco Sacchi */ @@ -57,8 +56,13 @@ int pcf8574_get(Pcf8574 *pcf) if (!i2c_start_r(PCF8574ID | ((pcf->addr << 1) & 0xF7))) return EOF; - int data = i2c_get(false); + int data; + + if (!i2c_recv(&data, 1)) + data = EOF; + i2c_stop(); + return data; }