Extract ReinitI2cMainBus()
This commit is contained in:
@@ -22,9 +22,7 @@ void PIT_I2C_WATCHDOG_HANDLER(void)
|
|||||||
|
|
||||||
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there haven't been any interrupts recently
|
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there haven't been any interrupts recently
|
||||||
I2cWatchdog_RecoveryCounter++;
|
I2cWatchdog_RecoveryCounter++;
|
||||||
I2C_MasterDeinit(I2C_MAIN_BUS_BASEADDR);
|
ReinitI2cMainBus();
|
||||||
InitI2cMainBus();
|
|
||||||
InitSlaveScheduler();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prevWatchdogCounter = I2C_Watchdog;
|
prevWatchdogCounter = I2C_Watchdog;
|
||||||
|
|||||||
@@ -83,6 +83,13 @@ void InitI2cMainBus(void)
|
|||||||
I2C_MasterInit(I2C_MAIN_BUS_BASEADDR, &masterConfig, sourceClock);
|
I2C_MasterInit(I2C_MAIN_BUS_BASEADDR, &masterConfig, sourceClock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReinitI2cMainBus(void)
|
||||||
|
{
|
||||||
|
I2C_MasterDeinit(I2C_MAIN_BUS_BASEADDR);
|
||||||
|
InitI2cMainBus();
|
||||||
|
InitSlaveScheduler();
|
||||||
|
}
|
||||||
|
|
||||||
void initI2cEepromBus(void)
|
void initI2cEepromBus(void)
|
||||||
{
|
{
|
||||||
port_pin_config_t pinConfig = {
|
port_pin_config_t pinConfig = {
|
||||||
|
|||||||
@@ -9,5 +9,6 @@
|
|||||||
|
|
||||||
void InitPeripherals(void);
|
void InitPeripherals(void);
|
||||||
void InitI2cMainBus(void);
|
void InitI2cMainBus(void);
|
||||||
|
void ReinitI2cMainBus(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user