summaryrefslogtreecommitdiff
path: root/drivers/arm/i2c_master.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/arm/i2c_master.c')
-rw-r--r--drivers/arm/i2c_master.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c
index 2a7badd351..de58438392 100644
--- a/drivers/arm/i2c_master.c
+++ b/drivers/arm/i2c_master.c
@@ -26,6 +26,7 @@
*/
#include "i2c_master.h"
+#include "quantum.h"
#include <string.h>
#include <hal.h>
@@ -41,9 +42,11 @@ static const I2CConfig i2cconfig = {
0
};
+__attribute__ ((weak))
void i2c_init(void)
{
- palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); // Try releasing special pins for a short time
+ setPinInput(B6); // Try releasing special pins for a short time
+ setPinInput(B7);
chThdSleepMilliseconds(10);
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);