}
-uint8_t i2cm_send_byte(uint8_t byte)
+static uint8_t i2cm_send_byte(uint8_t byte)
{
uint8_t mask;
uint8_t err = 0;
I2CM_DELAY();
mask >>=1;
- // delay needed ?
- //I2CM_DELAY();
-
// clock High
I2C_HIGH(I2CM_SCL_PORT, I2CM_SCL_BIT);
I2CM_DELAY();
I2CM_DELAY();
while ( bit_is_clear(PIN(I2CM_SCL_PORT), I2CM_SCL_BIT) );// slave handshake
- // receive ACK
- if (bit_is_set(I2CM_SDA_PORT, I2CM_SDA_BIT))
+ // we should receive ACK
+ if (bit_is_set(PIN(I2CM_SDA_PORT), I2CM_SDA_BIT))
err = I2CM_SENT_NO_ACK;
// clock low