diff --git a/zh_avr_i2c.c b/zh_avr_i2c.c index 3b0974c..9ac8e45 100644 --- a/zh_avr_i2c.c +++ b/zh_avr_i2c.c @@ -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; }