mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
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
1 changed files with 2 additions and 1 deletions
|
@ -261,7 +261,8 @@ bool i2c_poll(unsigned char slave_addr)
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
i2c_start();
|
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();
|
i2c_stop();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue