This commit is contained in:
2025-08-09 12:50:30 +03:00
parent 1284e245cc
commit 3e31aa3683

View File

@@ -49,11 +49,11 @@ avr_err_t zh_avr_i2c_master_probe(const uint8_t addr, TickType_t xTicksToWait)
_target_i2c_address = addr;
TWCR = I2C_START | (1 << TWSTA);
EventBits_t bits = xEventGroupWaitBits(_event_group_handle, I2C_OK | I2C_NACK | I2C_COLLISION | I2C_BUS_FAIL, pdTRUE, pdFALSE, xTicksToWait);
if (bits & I2C_OK)
if ((bits & I2C_OK) != 0)
{
return AVR_OK;
}
else if (bits & I2C_NACK)
else if ((bits & I2C_NACK) != 0)
{
return AVR_ERR_INVALID_RESPONSE;
}