1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 04:42:21 +01:00

Add parameter to control i2c stop signal at endTransmission (#3370)

This commit is contained in:
Keilin Bickar
2022-04-10 16:38:29 -04:00
committed by GitHub
parent 5e79a1f500
commit a9e653724c
8 changed files with 29 additions and 19 deletions

View File

@@ -104,7 +104,7 @@ ErrorCode ArduinoI2CBus::readv(uint8_t address, ReadBuffer *buffers, size_t cnt)
return ERROR_OK;
}
ErrorCode ArduinoI2CBus::writev(uint8_t address, WriteBuffer *buffers, size_t cnt) {
ErrorCode ArduinoI2CBus::writev(uint8_t address, WriteBuffer *buffers, size_t cnt, bool stop) {
// logging is only enabled with vv level, if warnings are shown the caller
// should log them
if (!initialized_) {
@@ -139,7 +139,7 @@ ErrorCode ArduinoI2CBus::writev(uint8_t address, WriteBuffer *buffers, size_t cn
return ERROR_UNKNOWN;
}
}
uint8_t status = wire_->endTransmission(true);
uint8_t status = wire_->endTransmission(stop);
if (status == 0) {
return ERROR_OK;
} else if (status == 1) {