From a9d4f6bb2eb2066c32404cb517d84dadd2161b24 Mon Sep 17 00:00:00 2001 From: asterix Date: Wed, 7 Jul 2010 16:08:40 +0000 Subject: [PATCH] Use recv instead get. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4008 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/pcf8574.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bertos/drv/pcf8574.c b/bertos/drv/pcf8574.c index a61893fc..5572e40c 100644 --- a/bertos/drv/pcf8574.c +++ b/bertos/drv/pcf8574.c @@ -56,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; } -- 2.25.1