[hal, wpilib] Add initial systemcore counter implementation (#7723)

This commit is contained in:
Thad House
2025-01-28 08:58:34 -08:00
committed by GitHub
parent b799b285b3
commit 48ce2dcc8d
47 changed files with 201 additions and 4357 deletions

View File

@@ -164,4 +164,17 @@ int32_t SmartIo::GetAnalogInput(uint16_t* value) {
return 0;
}
int32_t SmartIo::GetCounter(int32_t* value) {
if (currentMode != SmartIoMode::SingleCounterFalling &&
currentMode != SmartIoMode::SingleCounterRising) {
return INCOMPATIBLE_STATE;
}
int32_t val = getSubscriber.Get();
*value = val;
return 0;
}
} // namespace hal