Code: Select all
short unsigned int I2CPORTS[8] = {0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F};
void PullPort(short unsigned int Port) {
short unsigned int Address;
Port -= 6;
Address = (Port&0xF8)>>3;
dp_I2C_Write(Address, I2CPORTS[(Port&=0x07)]);
dp_I2C_Write(((Port&0xF8)>>3), I2CPORTS[(Port&=0x07)]); // dosen't work - WHY???
}
Can anyone explain - please...
The funny thing is, that there is no problem with the second parameter. But that value is not so complicated to calculate, and it is only used for computing an index into an array.
Thanks in advance
/Jacob