diff options
Diffstat (limited to 'drivers/arm/i2c_master.c')
| -rw-r--r-- | drivers/arm/i2c_master.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index 2a7badd35..de5843839 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #include "i2c_master.h" | 28 | #include "i2c_master.h" |
| 29 | #include "quantum.h" | ||
| 29 | #include <string.h> | 30 | #include <string.h> |
| 30 | #include <hal.h> | 31 | #include <hal.h> |
| 31 | 32 | ||
| @@ -41,9 +42,11 @@ static const I2CConfig i2cconfig = { | |||
| 41 | 0 | 42 | 0 |
| 42 | }; | 43 | }; |
| 43 | 44 | ||
| 45 | __attribute__ ((weak)) | ||
| 44 | void i2c_init(void) | 46 | void i2c_init(void) |
| 45 | { | 47 | { |
| 46 | palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); // Try releasing special pins for a short time | 48 | setPinInput(B6); // Try releasing special pins for a short time |
| 49 | setPinInput(B7); | ||
| 47 | chThdSleepMilliseconds(10); | 50 | chThdSleepMilliseconds(10); |
| 48 | 51 | ||
| 49 | palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); | 52 | palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); |
