Add I2C_WatchdogOuterCounter, I2C_WatchdogInnerCounter, BridgeCounter and expose them via USB getDebugInfo()

This commit is contained in:
László Monda
2017-08-19 12:12:49 +02:00
parent 35102918b2
commit 58f36cf6c3
5 changed files with 29 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
uint8_t previousSlaveId = 0;
uint8_t currentSlaveId = 0;
uint32_t BridgeCounter;
uhk_slave_t Slaves[] = {
{ .initializer = UhkModuleSlaveDriver_Init, .updater = UhkModuleSlaveDriver_Update, .perDriverId = UhkModuleId_LeftKeyboardHalf },
@@ -22,6 +23,7 @@ static void bridgeProtocolCallback(I2C_Type *base, i2c_master_handle_t *handle,
IsI2cTransferScheduled = false;
do {
BridgeCounter++;
if (TestStates.disableI2c) {
return;
}
@@ -36,6 +38,9 @@ static void bridgeProtocolCallback(I2C_Type *base, i2c_master_handle_t *handle,
}
currentSlave->updater(currentSlave->perDriverId);
if (IsI2cTransferScheduled) {
currentSlave->isConnected = true;
}
previousSlaveId = currentSlaveId;
currentSlaveId++;