diff --git a/mkspecs/features/stm32f4/syscalls.c b/mkspecs/features/stm32f4/syscalls.c --- a/mkspecs/features/stm32f4/syscalls.c +++ b/mkspecs/features/stm32f4/syscalls.c @@ -11,6 +11,7 @@ #include #include #include +#include #undef errno diff --git a/src/stm32f4/I2C/i2c.c b/src/stm32f4/I2C/i2c.c --- a/src/stm32f4/I2C/i2c.c +++ b/src/stm32f4/I2C/i2c.c @@ -40,7 +40,8 @@ i2c_t i2copen(int count) #define _INIT_DEV(_RCC_) \ RCC_APB1PeriphClockCmd(_RCC_, ENABLE); \ RCC_APB1PeriphResetCmd(_RCC_, ENABLE); \ - RCC_APB1PeriphResetCmd(_RCC_, DISABLE); + RCC_APB1PeriphResetCmd(_RCC_, DISABLE); \ + RCC_APB1PeriphClockCmd(_RCC_, ENABLE); switch(count) {