Fix IDFI2CBus::writev ignoring stop parameter (#4840)

Co-authored-by: Alexander Dimitrov <admin@sharkydog.info>
This commit is contained in:
Carson Full 2023-08-15 18:13:43 -05:00 committed by Jesse Hills
parent ff8a73c2d1
commit 48e4cb5ae2
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -202,12 +202,14 @@ ErrorCode IDFI2CBus::writev(uint8_t address, WriteBuffer *buffers, size_t cnt, b
return ERROR_UNKNOWN; return ERROR_UNKNOWN;
} }
} }
if (stop) {
err = i2c_master_stop(cmd); err = i2c_master_stop(cmd);
if (err != ESP_OK) { if (err != ESP_OK) {
ESP_LOGVV(TAG, "TX to %02X master stop failed: %s", address, esp_err_to_name(err)); ESP_LOGVV(TAG, "TX to %02X master stop failed: %s", address, esp_err_to_name(err));
i2c_cmd_link_delete(cmd); i2c_cmd_link_delete(cmd);
return ERROR_UNKNOWN; return ERROR_UNKNOWN;
} }
}
err = i2c_master_cmd_begin(port_, cmd, 20 / portTICK_PERIOD_MS); err = i2c_master_cmd_begin(port_, cmd, 20 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd); i2c_cmd_link_delete(cmd);
if (err == ESP_FAIL) { if (err == ESP_FAIL) {