Rename I2C_Watchdog*Counter to I2cWatchdog_*Counter.
This commit is contained in:
@@ -9,18 +9,19 @@
|
||||
#define PIT_I2C_WATCHDOG_IRQ_ID PIT0_IRQn
|
||||
#define PIT_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_BusClk)
|
||||
|
||||
uint32_t I2cWatchdog_OuterCounter;
|
||||
uint32_t I2cWatchdog_InnerCounter;
|
||||
|
||||
static uint32_t prevWatchdogCounter;
|
||||
uint32_t I2C_WatchdogInnerCounter;
|
||||
uint32_t I2C_WatchdogOuterCounter;
|
||||
|
||||
// This function restarts and reinstalls the I2C handler when the I2C bus gets unresponsive
|
||||
// by a misbehaving I2C slave, or by disconnecting the left keyboard half or an add-on module.
|
||||
// This method relies on a patched KSDK which increments I2C_Watchdog upon I2C transfers.
|
||||
void PIT_I2C_WATCHDOG_HANDLER(void)
|
||||
{
|
||||
I2C_WatchdogOuterCounter++;
|
||||
I2cWatchdog_OuterCounter++;
|
||||
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there hasn't be any interrupt during 100 ms
|
||||
I2C_WatchdogInnerCounter++;
|
||||
I2cWatchdog_InnerCounter++;
|
||||
i2c_master_config_t masterConfig;
|
||||
I2C_MasterGetDefaultConfig(&masterConfig);
|
||||
I2C_MasterDeinit(I2C_MAIN_BUS_BASEADDR);
|
||||
|
||||
Reference in New Issue
Block a user