PaulStoffregen 8 anni fa
parent
commit
b6b42cef5f
1 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. +10
    -2
      Wire.cpp

+ 10
- 2
Wire.cpp Vedi File

i2c_wait(); i2c_wait();
length--; length--;
if (length == 1) I2C0_C1 = I2C_C1_IICEN | I2C_C1_MST | I2C_C1_TXAK; if (length == 1) I2C0_C1 = I2C_C1_IICEN | I2C_C1_MST | I2C_C1_TXAK;
rxBuffer[count++] = I2C0_D;
if (count < BUFFER_LENGTH) {
rxBuffer[count++] = I2C0_D;
} else {
tmp = I2C0_D;
}
} }
i2c_wait(); i2c_wait();
I2C0_C1 = I2C_C1_IICEN | I2C_C1_MST | I2C_C1_TX; I2C0_C1 = I2C_C1_IICEN | I2C_C1_MST | I2C_C1_TX;
rxBuffer[count++] = I2C0_D;
if (count < BUFFER_LENGTH) {
rxBuffer[count++] = I2C0_D;
} else {
tmp = I2C0_D;
}
if (sendStop) I2C0_C1 = I2C_C1_IICEN; if (sendStop) I2C0_C1 = I2C_C1_IICEN;
rxBufferLength = count; rxBufferLength = count;
return count; return count;

Loading…
Annulla
Salva