Use recv instead get.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 7 Jul 2010 16:08:40 +0000 (16:08 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 7 Jul 2010 16:08:40 +0000 (16:08 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4008 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/pcf8574.c

index a61893fc213d2a371675d43bb799713f4e2647a0..5572e40ce3ce29803315fa3bfc3b45d541d7f8ed 100644 (file)
@@ -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;
 }