Rename bridgeSlaves to slaves.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
uint8_t currentBridgeSlaveId = 0;
|
||||
|
||||
uhk_slave_t bridgeSlaves[] = {
|
||||
uhk_slave_t slaves[] = {
|
||||
{ .slaveHandler = UhkSlaveUhkModuleHandler, .moduleId = 0 },
|
||||
{ .slaveHandler = UhkSlaveLedDriverHandler, .moduleId = 0 },
|
||||
{ .slaveHandler = UhkSlaveLedDriverHandler, .moduleId = 1 },
|
||||
@@ -21,12 +21,12 @@ static void bridgeProtocolCallback(I2C_Type *base, i2c_master_handle_t *handle,
|
||||
if (TestStates.disableI2c) {
|
||||
return;
|
||||
}
|
||||
uhk_slave_t *bridgeSlave = bridgeSlaves + currentBridgeSlaveId;
|
||||
uhk_slave_t *bridgeSlave = slaves + currentBridgeSlaveId;
|
||||
|
||||
bridgeSlave->slaveHandler(bridgeSlave->moduleId);
|
||||
currentBridgeSlaveId++;
|
||||
|
||||
if (currentBridgeSlaveId >= (sizeof(bridgeSlaves) / sizeof(uhk_slave_t))) {
|
||||
if (currentBridgeSlaveId >= (sizeof(slaves) / sizeof(uhk_slave_t))) {
|
||||
currentBridgeSlaveId = 0;
|
||||
}
|
||||
}
|
||||
@@ -38,5 +38,5 @@ void InitSlaveScheduler()
|
||||
I2C_MasterTransferCreateHandle(I2C_MAIN_BUS_BASEADDR, &I2cMasterHandle, bridgeProtocolCallback, NULL);
|
||||
|
||||
// Kickstart the scheduler by triggering the first callback.
|
||||
bridgeSlaves[0].slaveHandler(bridgeSlaves[0].moduleId);
|
||||
slaves[0].slaveHandler(slaves[0].moduleId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user