Add kStatus_Uhk_NoOp and make the scheduler handle it.
This commit is contained in:
@@ -39,6 +39,7 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleId)
|
||||
if (CRC16_IsMessageValid(rxBuffer, KEY_STATE_SIZE)) {
|
||||
BoolBitsToBytes(rxBuffer, CurrentKeyStates[SLOT_ID_LEFT_KEYBOARD_HALF], LEFT_KEYBOARD_HALF_KEY_COUNT);
|
||||
}
|
||||
status = kStatus_Uhk_NoOp;
|
||||
uhkModulePhase = UhkModulePhase_SetLedPwmBrightness;
|
||||
break;
|
||||
case UhkModulePhase_SetLedPwmBrightness:
|
||||
|
||||
@@ -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;
|
||||
if (currentStatus != kStatus_Uhk_NoOp) {
|
||||
currentSlaveId++;
|
||||
}
|
||||
|
||||
if (currentSlaveId >= (sizeof(Slaves) / sizeof(uhk_slave_t))) {
|
||||
currentSlaveId = 0;
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
} uhk_status_group_t;
|
||||
|
||||
typedef enum {
|
||||
kStatus_Uhk_IdleSlave = MAKE_STATUS(kStatusGroup_Uhk, 0),
|
||||
kStatus_Uhk_IdleSlave = MAKE_STATUS(kStatusGroup_Uhk, 0), // An other slave should be scheduled
|
||||
kStatus_Uhk_NoOp = MAKE_STATUS(kStatusGroup_Uhk, 1), // The same slave should be rescheduled
|
||||
} uhk_status_t;
|
||||
|
||||
// Variables:
|
||||
|
||||
Reference in New Issue
Block a user