Add kStatus_Uhk_NoOp and make the scheduler handle it.

This commit is contained in:
László Monda
2017-09-22 14:32:43 +02:00
parent 2aa74853b5
commit ef9d9ee9a7
3 changed files with 7 additions and 3 deletions

View File

@@ -34,14 +34,16 @@ static void masterCallback(I2C_Type *base, i2c_master_handle_t *handle, status_t
}
status_t currentStatus = currentSlave->update(currentSlave->perDriverId);
isTransferScheduled = currentStatus != kStatus_Uhk_IdleSlave;
isTransferScheduled = currentStatus != kStatus_Uhk_IdleSlave && currentStatus != kStatus_Uhk_NoOp;
//isTransferScheduled = currentStatus == kStatus_Success // Why it is not working?
if (isTransferScheduled) {
currentSlave->isConnected = true;
}
previousSlaveId = currentSlaveId;
currentSlaveId++;
if (currentStatus != kStatus_Uhk_NoOp) {
currentSlaveId++;
}
if (currentSlaveId >= (sizeof(Slaves) / sizeof(uhk_slave_t))) {
currentSlaveId = 0;