mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Makes the CANJaguar error status messages more useful (#165)
The previous version would just return the class name for the DigitalOutput port. Now it actually gets the dio port value for better readability.
This commit is contained in:
committed by
Peter Johnson
parent
edf5ecd4a0
commit
ea1a1e6bc3
@@ -72,6 +72,20 @@ void DigitalOutput::Set(bool value) {
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value being output from the Digital Output.
|
||||
*
|
||||
* @return the state of the digital output.
|
||||
*/
|
||||
bool DigitalOutput::Get() {
|
||||
if (StatusIsFatal()) return false;
|
||||
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetDIO(m_handle, &status);
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The GPIO channel number that this object represents.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user