1
0
Fork 0

fixed I2C driver support for stm32f4 (#7526)

* correct i2c driver for stm32f4

* update pin mode definitions

* update macro definition
This commit is contained in:
yulei 2019-12-13 09:20:04 +08:00 committed by Drashna Jaelre
parent df78593b1b
commit a037cedfdc
2 changed files with 16 additions and 10 deletions

View file

@ -62,7 +62,7 @@ __attribute__((weak)) void i2c_init(void) {
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_INPUT);
chThdSleepMilliseconds(10);
#ifdef USE_I2CV1
#if defined(USE_GPIOV1)
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_STM32_ALTERNATE_OPENDRAIN);
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_STM32_ALTERNATE_OPENDRAIN);
#else