From c22ad4d829bef959836b8627a4d22338ea77fb04 Mon Sep 17 00:00:00 2001 From: johanknol Date: Fri, 20 Oct 2000 09:23:33 +0000 Subject: [PATCH] fixed operator precedance bug git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@479 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- device/examples/ds390/i2c390/pcf8591.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/device/examples/ds390/i2c390/pcf8591.c b/device/examples/ds390/i2c390/pcf8591.c index 4d86e8e7..c6f3981c 100644 --- a/device/examples/ds390/i2c390/pcf8591.c +++ b/device/examples/ds390/i2c390/pcf8591.c @@ -1,21 +1,16 @@ #include "i2clole.h" #include "pcf8591.h" -#if 0 || FIND_OPERATOR_PRECEDING_INCONSISTANCY -#undef PCF8591_ID -#define PCF8591_ID 0x90; -#endif - unsigned char ReadPCF8591(char address, char channel) { - unsigned char id=PCF8591_ID+address<<1; + unsigned char id=PCF8591_ID+(address<<1); while (!I2CReset()) { //fprintf (stderr, "I2C bus busy, retrying.\n"); } // set output enable, no autoincrement - i2cTransmitBuffer[0]=channel&0x03+0x40; + i2cTransmitBuffer[0]=(channel&0x03)+0x40; // read 2 bytes, since the first one is the old value if (I2CSendReceive(id, 1, 2)) -- 2.30.2