mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
[wpilib, hal] DigitalGlitchFilter: Fix sim crash and clean up construction (#6937)
Fixes error when >3 are constructed- in java, m_filterAllocated[index] would be evaluated before the bounds check and throw IndexOutOfBounds, in c++ a vague assertion error would be thrown. Makes DoAdd static in c++ Makes the error message when HAL_SetFilterSelect fails consistent with java
This commit is contained in:
@@ -50,6 +50,7 @@ struct DigitalPort {
|
||||
int32_t centerPwm = 0;
|
||||
int32_t deadbandMinPwm = 0;
|
||||
int32_t minPwm = 0;
|
||||
int32_t filterIndex = 0;
|
||||
std::string previousAllocation;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user