Add I2C_Watchdog variable that gets incremented upon I2C slave operations.

This commit is contained in:
László Monda
2017-09-21 21:34:23 +02:00
parent c02d0df05b
commit ac55fc28ee
2 changed files with 6 additions and 0 deletions

View File

@@ -146,6 +146,9 @@ static i2c_isr_t s_i2cMasterIsr;
/*! @brief Pointer to slave IRQ handler for each instance. */
static i2c_isr_t s_i2cSlaveIsr;
/* @brief Extern counter to ensure that I2C is always alive */
volatile uint32_t I2C_Watchdog;
/*******************************************************************************
* Codes
******************************************************************************/
@@ -1386,6 +1389,7 @@ void I2C_SlaveTransferHandleIRQ(I2C_Type *base, void *i2cHandle)
/* Add this to avoid build warning. */
dummy++;
I2C_Watchdog++;
status = I2C_SlaveGetStatusFlags(base);
xfer = &(handle->transfer);

View File

@@ -32,6 +32,8 @@
#include "fsl_common.h"
extern volatile uint32_t I2C_Watchdog;
/*!
* @addtogroup i2c_driver
* @{