Created
November 13, 2014 15:34
-
-
Save patrickelectric/96298336806d4ab40778 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// must be called in: | |
// slave tx event callback | |
// or after beginTransmission(address) | |
size_t TwoWire::write(const uint8_t *data, size_t quantity) | |
{ | |
if(transmitting){ | |
// in master transmitter mode | |
for(size_t i = 0; i < quantity; ++i){ | |
write(data[i]); | |
} | |
}else{ | |
// in slave send mode | |
// reply to master | |
twi_transmit(data, quantity); | |
} | |
return quantity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment