diff --git a/src/i2c.c b/src/i2c.c --- a/src/i2c.c +++ b/src/i2c.c @@ -9,10 +9,12 @@ I2C_HandleTypeDef hi2c1; void i2c_init(void) { + __GPIOA_CLK_ENABLE(); + GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; GPIO_InitStruct.Alternate = GPIO_AF4_I2C1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); @@ -35,7 +37,7 @@ void i2c_init(void) // Get pointer to I2C port -inline I2C_HandleTypeDef* i2c_get(void) +I2C_HandleTypeDef* i2c_get(void) { return &hi2c1; }