diff options
author | Joel Challis <git@zvecr.com> | 2020-07-25 22:50:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 07:50:56 +1000 |
commit | d91987ab9adbf7bba9f47deb6b30a02d28e7195d (patch) | |
tree | 6356f4f6c167dd2b50dec84a5124418cb9d649fc /drivers/chibios/i2c_master.c | |
parent | db540e2832b0d3bed6ae2ca3a2c893d9c79a7f5d (diff) | |
download | qmk_firmware-d91987ab9adbf7bba9f47deb6b30a02d28e7195d.tar.gz |
Enable OLED support for Teensy 3.2/LC (#7591)
* I2C_TIMEOUT is not defined on arm teensy
* Work round teensy having different ChibiOS config options
* Stash OLED conf files
* update comment
* update comment
* Remove stm32 alias to allow teensy alt mode
Diffstat (limited to 'drivers/chibios/i2c_master.c')
-rw-r--r-- | drivers/chibios/i2c_master.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/chibios/i2c_master.c b/drivers/chibios/i2c_master.c index ede915fa4..4bd8e2af7 100644 --- a/drivers/chibios/i2c_master.c +++ b/drivers/chibios/i2c_master.c @@ -32,7 +32,9 @@ static uint8_t i2c_address; static const I2CConfig i2cconfig = { -#ifdef USE_I2CV1 +#if defined(USE_I2CV1_CONTRIB) + I2C1_CLOCK_SPEED, +#elif defined(USE_I2CV1) I2C1_OPMODE, I2C1_CLOCK_SPEED, I2C1_DUTY_CYCLE, @@ -62,8 +64,8 @@ __attribute__((weak)) void i2c_init(void) { chThdSleepMilliseconds(10); #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); + palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, I2C1_SCL_PAL_MODE); + palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, I2C1_SDA_PAL_MODE); #else palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); |