mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #973 from openmv/cambus_init
Initialize all I2C handle unused fields.
This commit is contained in:
commit
11d7cde25b
@ -33,6 +33,9 @@ int cambus_init(I2C_HandleTypeDef *i2c, I2C_TypeDef *instance, uint32_t timing)
|
|||||||
i2c->Init.NoStretchMode = I2C_NOSTRETCH_DISABLED;
|
i2c->Init.NoStretchMode = I2C_NOSTRETCH_DISABLED;
|
||||||
i2c->Init.OwnAddress1 = 0xFE;
|
i2c->Init.OwnAddress1 = 0xFE;
|
||||||
i2c->Init.OwnAddress2 = 0xFE;
|
i2c->Init.OwnAddress2 = 0xFE;
|
||||||
|
#if !defined(STM32F4)
|
||||||
|
i2c->Init.OwnAddress2Masks = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
HAL_I2C_DeInit(i2c);
|
HAL_I2C_DeInit(i2c);
|
||||||
if (HAL_I2C_Init(i2c) != HAL_OK) {
|
if (HAL_I2C_Init(i2c) != HAL_OK) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user