mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Fixes SPI Accumulator averages (#415)
This commit is contained in:
committed by
Peter Johnson
parent
841f016017
commit
fddb6cd9d8
@@ -634,7 +634,7 @@ int64_t HAL_GetSPIAccumulatorCount(int32_t port, int32_t* status) {
|
||||
double HAL_GetSPIAccumulatorAverage(int32_t port, int32_t* status) {
|
||||
int64_t value;
|
||||
int64_t count;
|
||||
HAL_GetAccumulatorOutput(port, &value, &count, status);
|
||||
HAL_GetSPIAccumulatorOutput(port, &value, &count, status);
|
||||
if (count == 0) return 0.0;
|
||||
return static_cast<double>(value) / count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user