Convert tabs to spaces.
This commit is contained in:
@@ -15,28 +15,28 @@
|
|||||||
|
|
||||||
void RunWatchdog(void)
|
void RunWatchdog(void)
|
||||||
{
|
{
|
||||||
static volatile uint32_t I2cWatchdog_WatchCounter = 0; /* counter for timer */
|
static volatile uint32_t I2cWatchdog_WatchCounter = 0; /* counter for timer */
|
||||||
static int cntr = 0;
|
static int cntr = 0;
|
||||||
|
|
||||||
cntr++;
|
cntr++;
|
||||||
if (cntr==100) { /* we get called from KEY_SCANNER_HANDLER() which runs at 1ms, thus scaling down by 100 here to get 100 ms period */
|
if (cntr==100) { /* we get called from KEY_SCANNER_HANDLER() which runs at 1ms, thus scaling down by 100 here to get 100 ms period */
|
||||||
cntr=0;
|
cntr=0;
|
||||||
TEST_LED_TOGGLE();
|
TEST_LED_TOGGLE();
|
||||||
I2cWatchdog_WatchCounter++;
|
I2cWatchdog_WatchCounter++;
|
||||||
|
|
||||||
if (I2cWatchdog_WatchCounter>10) { /* do not check within the first 1000 ms, as I2C might not be running yet */
|
if (I2cWatchdog_WatchCounter>10) { /* do not check within the first 1000 ms, as I2C might not be running yet */
|
||||||
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there hasn't been any interrupt during 100 ms. I2C_Watchdog gets incremented for every I2C transaction
|
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there hasn't been any interrupt during 100 ms. I2C_Watchdog gets incremented for every I2C transaction
|
||||||
I2cWatchdog_RecoveryCounter++;
|
I2cWatchdog_RecoveryCounter++;
|
||||||
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REBOOT
|
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REBOOT
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
#endif
|
#endif
|
||||||
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REINIT
|
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REINIT
|
||||||
I2C_SlaveDeinit(I2C_BUS_BASEADDR);
|
I2C_SlaveDeinit(I2C_BUS_BASEADDR);
|
||||||
InitI2c();
|
InitI2c();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevWatchdogCounter = I2C_Watchdog; /* remember previous counter */
|
prevWatchdogCounter = I2C_Watchdog; /* remember previous counter */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user