mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Added I2C clock stretching.
This commit is contained in:
parent
08ff559ccf
commit
16d9a952a2
2 changed files with 5 additions and 0 deletions
|
@ -422,6 +422,9 @@ void i2cInit(I2CDevice device)
|
||||||
|
|
||||||
I2C_Cmd(i2c->dev, ENABLE);
|
I2C_Cmd(i2c->dev, ENABLE);
|
||||||
I2C_Init(i2c->dev, &i2cInit);
|
I2C_Init(i2c->dev, &i2cInit);
|
||||||
|
|
||||||
|
I2C_StretchClockCmd(i2c->dev, ENABLE);
|
||||||
|
|
||||||
|
|
||||||
// I2C ER Interrupt
|
// I2C ER Interrupt
|
||||||
nvic.NVIC_IRQChannel = i2c->er_irq;
|
nvic.NVIC_IRQChannel = i2c->er_irq;
|
||||||
|
|
|
@ -101,6 +101,8 @@ void i2cInit(I2CDevice device)
|
||||||
|
|
||||||
I2C_Init(I2Cx, &i2cInit);
|
I2C_Init(I2Cx, &i2cInit);
|
||||||
|
|
||||||
|
I2C_StretchClockCmd(I2Cx, ENABLE);
|
||||||
|
|
||||||
I2C_Cmd(I2Cx, ENABLE);
|
I2C_Cmd(I2Cx, ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue