Код: Выделить всё
esp_err_t I2CManager::writeData(uint8_t deviceAddress, const uint8_t* data, size_t length, int timeOut, uint32_t speed)
{
esp_err_t errCode = ESP_ERR_TIMEOUT;
ssize_t deviceSlot = findDeviceSlot(deviceAddress);
if(i2c_master_bus_handle == nullptr)
{
errCode = ESP_ERR_NOT_FOUND;
goto function_return;
}
if(deviceSlot == -1)
{
deviceSlot = addNewDevice(deviceAddress, speed);
}
//now we got everything - the bus and the device
errCode = i2c_master_transmit(dev_handles[deviceSlot].dev_handle, data, length, timeOut);
function_return:
return errCode;
}

[img]https: //i.sstatic.net/pLjtZ4fg.png[/img]

второе условие STOP генерируется по истечении времени ожидания. Как заставить водителя не подавать второй СТОП
Подробнее здесь: https://stackoverflow.com/questions/790 ... p-conditio