diff --git a/right/src/i2c_watchdog.c b/right/src/i2c_watchdog.c index 954e19e..85ad54c 100644 --- a/right/src/i2c_watchdog.c +++ b/right/src/i2c_watchdog.c @@ -19,17 +19,15 @@ static uint32_t prevWatchdogCounter; void PIT_I2C_WATCHDOG_HANDLER(void) { I2cWatchdog_WatchCounter++; + if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there haven't been any interrupts recently I2cWatchdog_RecoveryCounter++; - i2c_master_config_t masterConfig; - I2C_MasterGetDefaultConfig(&masterConfig); I2C_MasterDeinit(I2C_MAIN_BUS_BASEADDR); InitI2cMainBus(); InitSlaveScheduler(); } prevWatchdogCounter = I2C_Watchdog; - PIT_ClearStatusFlags(PIT, PIT_I2C_WATCHDOG_CHANNEL, PIT_TFLG_TIF_MASK); } diff --git a/right/src/init_peripherals.c b/right/src/init_peripherals.c index 79bcc2e..7f6c752 100644 --- a/right/src/init_peripherals.c +++ b/right/src/init_peripherals.c @@ -91,7 +91,6 @@ void initI2cEepromBus(void) .mux = I2C_EEPROM_BUS_MUX, }; - CLOCK_EnableClock(I2C_EEPROM_BUS_SDA_CLOCK); CLOCK_EnableClock(I2C_EEPROM_BUS_SCL_CLOCK);