mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[hal] Error if attempting to set DIO output on an input port (#3436)
This commit is contained in:
@@ -174,6 +174,11 @@ void HAL_SetDIO(HAL_DigitalHandle dioPortHandle, HAL_Bool value,
|
||||
value = 1;
|
||||
}
|
||||
}
|
||||
if (SimDIOData[port->channel].isInput) {
|
||||
*status = PARAMETER_OUT_OF_RANGE;
|
||||
hal::SetLastError(status, "Cannot set output of an input channel");
|
||||
return;
|
||||
}
|
||||
SimDIOData[port->channel].value = value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user