mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Deinit I2C bus before re-initializing.
* Fixes occasional failure when sensor I2C is shared with micropython.
This commit is contained in:
parent
d22fa88943
commit
1deb8b6c90
@ -34,6 +34,7 @@ int cambus_init(I2C_HandleTypeDef *i2c, I2C_TypeDef *instance, uint32_t timing)
|
||||
i2c->Init.OwnAddress1 = 0xFE;
|
||||
i2c->Init.OwnAddress2 = 0xFE;
|
||||
|
||||
HAL_I2C_DeInit(i2c);
|
||||
if (HAL_I2C_Init(i2c) != HAL_OK) {
|
||||
/* Initialization Error */
|
||||
return -1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user