mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix cambus getting stuck sometimes after failed scan.
* This seems to only affect the H7. * After a failed scan the bus can get stuck. Re-initializing the bus fixes it, but it seems disabling and re-enabling the bus is all that's needed.
This commit is contained in:
parent
d618e6dfe5
commit
9f748c7950
@ -264,7 +264,13 @@ int cambus_scan(cambus_t *bus)
|
||||
return (addr << 1);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(STM32H7)
|
||||
// After a failed scan the bus can get stuck. Re-initializing the bus fixes
|
||||
// it, but it seems disabling and re-enabling the bus is all that's needed.
|
||||
__HAL_I2C_DISABLE(bus->i2c);
|
||||
mp_hal_delay_ms(10);
|
||||
__HAL_I2C_ENABLE(bus->i2c);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user