Skip to content

Commit 2869e9b

Browse files
committed
Fix wrong i2c id range check
i2c_take_by_chipid should check chip_id against I2C_CHIP_CNT. This fixes the PCIe link never coming up and other problems related to I2C access.
1 parent c067cb7 commit 2869e9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool i2c_take_by_busid( uint8_t bus_id, uint8_t *i2c_interface, TickType_t timeo
8585

8686
bool i2c_take_by_chipid( uint8_t chip_id, uint8_t *i2c_address, uint8_t *i2c_interface, uint32_t timeout )
8787
{
88-
if ( chip_id > I2C_BUS_CNT ) {
88+
if ( chip_id > I2C_CHIP_CNT ) {
8989
return false;
9090
}
9191

0 commit comments

Comments
 (0)