diff --git a/left/src/config.h b/left/src/config.h index 885a1b6..83e512b 100644 --- a/left/src/config.h +++ b/left/src/config.h @@ -3,11 +3,6 @@ // Macros: - #define I2C_WATCHDOG_VALUE_REINIT 1 - #define I2C_WATCHDOG_VALUE_REBOOT 2 - // #define DEBUG_OVER_SPI - #define I2C_WATCHDOG I2C_WATCHDOG_VALUE_REINIT -// #define I2C_WATCHDOG I2C_WATCHDOG_VALUE_REBOOT #endif diff --git a/left/src/i2c_watchdog.c b/left/src/i2c_watchdog.c index 40718a6..5fdb693 100644 --- a/left/src/i2c_watchdog.c +++ b/left/src/i2c_watchdog.c @@ -9,7 +9,6 @@ * See https://community.nxp.com/thread/457893 * Therefore the hardware watchdog timer cannot be used without an extra way to enter bootloader or application mode. */ -#ifdef I2C_WATCHDOG static uint32_t prevWatchdogCounter = 0; static uint32_t I2cWatchdog_RecoveryCounter; /* counter for how many times we had to recover and restart */ @@ -27,16 +26,10 @@ void RunWatchdog(void) 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 I2cWatchdog_RecoveryCounter++; -#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REBOOT - NVIC_SystemReset(); -#endif -#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REINIT I2C_SlaveDeinit(I2C_BUS_BASEADDR); initI2c(); -#endif } } prevWatchdogCounter = I2C_Watchdog; /* remember previous counter */ } } -#endif