Simplify driver in order to use less memory. The FIFO implementation had also a bug...
[bertos.git] / bertos / drv / pcf8574.c
index a9ed659e29191ecf32327a06f27e8bf7d634de54..a61893fc213d2a371675d43bb799713f4e2647a0 100644 (file)
  * each pin as input or output, see datasheet on how this
  * is achieved.
  *
- * \version $Id: ft245rl.c 22301 2008-09-09 16:53:17Z batt $
  * \author Francesco Sacchi <batt@develer.com>
  */
 
 #include "pcf8574.h"
+#include <cfg/module.h>
 #include <drv/i2c.h>
 
 /**
@@ -67,7 +67,9 @@ int pcf8574_get(Pcf8574 *pcf)
  */
 bool pcf8574_put(Pcf8574 *pcf, uint8_t data)
 {
-       return  i2c_start_w(PCF8574ID | ((pcf->addr << 1) & 0xF7)) && i2c_put(data) && i2c_stop();
+       bool res = i2c_start_w(PCF8574ID | ((pcf->addr << 1) & 0xF7)) && i2c_put(data);
+       i2c_stop();
+       return res;
 }
 
 /**