mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Add systemcore analog input (#7681)
This commit is contained in:
@@ -141,4 +141,16 @@ int32_t SmartIo::GetPwmMicroseconds(uint16_t* microseconds) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t SmartIo::GetAnalogInput(uint16_t* value) {
|
||||
if (currentMode != SmartIoMode::AnalogInput) {
|
||||
return INCOMPATIBLE_STATE;
|
||||
}
|
||||
|
||||
int val = getSubscriber.Get();
|
||||
|
||||
*value = val;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace hal
|
||||
|
||||
Reference in New Issue
Block a user