software/libbase/i2c/i2c_poll: Also test for write when polling since some I2C devices do not respond to read or require a specific protocol.
This commit is contained in:
parent
9806f76619
commit
1989d85b91
|
@ -261,7 +261,8 @@ bool i2c_poll(unsigned char slave_addr)
|
|||
bool result;
|
||||
|
||||
i2c_start();
|
||||
result = i2c_transmit_byte(I2C_ADDR_RD(slave_addr));
|
||||
result = i2c_transmit_byte(I2C_ADDR_WR(slave_addr));
|
||||
result |= i2c_transmit_byte(I2C_ADDR_RD(slave_addr));
|
||||
i2c_stop();
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue