diff --git a/platform/drivers/NVM/AT24Cx_GDx.c b/platform/drivers/NVM/AT24Cx_GDx.c index a9a64d9c..e9f50066 100644 --- a/platform/drivers/NVM/AT24Cx_GDx.c +++ b/platform/drivers/NVM/AT24Cx_GDx.c @@ -29,19 +29,15 @@ static const uint8_t devAddr = 0xA0; /* EEPROM I2C address */ void AT24Cx_init() { - gpio_setMode(I2C_SDA, OPEN_DRAIN); - gpio_setMode(I2C_SCL, OPEN_DRAIN); - gpio_setAlternateFunction(I2C_SDA, 3); - gpio_setAlternateFunction(I2C_SCL, 3); - - i2c0_init(); + /* + * Nothing to do here, on GDx devices the I2C bus is initialised in + * platform_init() before starting all the other modules. + */ } void AT24Cx_terminate() { - i2c0_terminate(); - gpio_setMode(I2C_SDA, INPUT); - gpio_setMode(I2C_SCL, INPUT); + } void AT24Cx_readData(uint32_t addr, void* buf, size_t len) diff --git a/platform/targets/DM-1801/platform.c b/platform/targets/DM-1801/platform.c index 884b204c..1167ac14 100644 --- a/platform/targets/DM-1801/platform.c +++ b/platform/targets/DM-1801/platform.c @@ -105,6 +105,8 @@ void platform_terminate() adc0_terminate(); pthread_mutex_destroy(&adc_mutex); + i2c0_terminate(); + /* Finally, remove power supply */ gpio_clearPin(PWR_SW); } diff --git a/platform/targets/GD-77/platform.c b/platform/targets/GD-77/platform.c index 69572a1b..93ca57e7 100644 --- a/platform/targets/GD-77/platform.c +++ b/platform/targets/GD-77/platform.c @@ -104,6 +104,8 @@ void platform_terminate() adc0_terminate(); pthread_mutex_destroy(&adc_mutex); + i2c0_terminate(); + /* Finally, remove power supply */ gpio_clearPin(PWR_SW); }