From 225a481938576427bca41d57a11699da1b0460d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 5 Aug 2018 22:31:48 +0200 Subject: [PATCH] Fix coding style. --- left/src/i2c_watchdog.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/left/src/i2c_watchdog.c b/left/src/i2c_watchdog.c index 2677699..98d7634 100644 --- a/left/src/i2c_watchdog.c +++ b/left/src/i2c_watchdog.c @@ -14,15 +14,15 @@ static uint32_t I2cWatchdog_RecoveryCounter; // Counter for how many times we ha void RunWatchdog(void) { static volatile uint32_t I2cWatchdog_WatchCounter = 0; // Counter for timer - static int cntr = 0; + static int counter = 0; - 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 - cntr=0; + counter++; + if (counter == 100) { // We get called from KEY_SCANNER_HANDLER() which runs at 1ms, thus scaling down by 100 here to get 100 ms period + counter=0; TestLed_Toggle(); 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 I2cWatchdog_RecoveryCounter++; I2C_SlaveDeinit(I2C_BUS_BASEADDR);