diff options
author | yulei <yuleiz@gmail.com> | 2019-12-13 09:20:04 +0800 |
---|---|---|
committer | Florian Didron <fdidron@users.noreply.github.com> | 2020-01-09 08:57:11 +0900 |
commit | 5f9e60bd95351062ad2c211a4f9ca40a7e936595 (patch) | |
tree | 68991fe9d70fb464b6a11290b7f875251ecdf4c7 /drivers/arm/i2c_master.c | |
parent | 20f465bfb677b2ec5438ece6914bc3963e802bff (diff) |
fixed I2C driver support for stm32f4 (#7526)
* correct i2c driver for stm32f4
* update pin mode definitions
* update macro definition
Diffstat (limited to 'drivers/arm/i2c_master.c')
-rw-r--r-- | drivers/arm/i2c_master.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index 18068d3a6d..5a03b9f306 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c @@ -60,8 +60,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 |