mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Throw exception if the REV Pneumatic Hub firmware version is older than 22.0.0 (#3853)
This commit is contained in:
@@ -54,6 +54,15 @@ class PneumaticHub::DataStore {
|
||||
m_moduleObject = PneumaticHub{handle, module};
|
||||
m_moduleObject.m_dataStore =
|
||||
std::shared_ptr<DataStore>{this, wpi::NullDeleter<DataStore>()};
|
||||
|
||||
auto version = m_moduleObject.GetVersion();
|
||||
if (version.FirmwareMajor > 0 && version.FirmwareMajor < 22) {
|
||||
throw FRC_MakeError(
|
||||
err::AssertionFailure,
|
||||
"The Pneumatic Hub has firmware version {}.{}.{}, and must be "
|
||||
"updated to version 2022.0.0 or later using the REV Hardware Client",
|
||||
version.FirmwareMajor, version.FirmwareMinor, version.FirmwareFix);
|
||||
}
|
||||
}
|
||||
|
||||
~DataStore() noexcept { HAL_FreeREVPH(m_moduleObject.m_handle); }
|
||||
|
||||
Reference in New Issue
Block a user