Only check currentSlaveId overrun after incrementing it.

This commit is contained in:
László Monda
2018-01-06 16:36:57 +01:00
parent 5a986d367e
commit da20cdacc4

View File

@@ -89,11 +89,11 @@ static void slaveSchedulerCallback(I2C_Type *base, i2c_master_handle_t *handle,
if (currentStatus != kStatus_Uhk_NoTransfer) {
previousSlaveId = currentSlaveId++;
if (currentSlaveId >= SLAVE_COUNT) {
currentSlaveId = 0;
}
}
if (currentSlaveId >= SLAVE_COUNT) {
currentSlaveId = 0;
}
} while (!isTransferScheduled);
}