[hal] Use last error reporting instead of PARAMETER_OUT_OF_RANGE (#3328)

Makes the error messages much more specific to each error.
This commit is contained in:
Thad House
2021-05-01 13:22:08 -07:00
committed by GitHub
parent 23d2326d1d
commit 3c08461685
15 changed files with 89 additions and 21 deletions

View File

@@ -267,10 +267,6 @@ Java_edu_wpi_first_hal_EncoderJNI_setEncoderSamplesToAverage
{
int32_t status = 0;
HAL_SetEncoderSamplesToAverage((HAL_EncoderHandle)id, value, &status);
if (status == PARAMETER_OUT_OF_RANGE) {
ThrowBoundaryException(env, value, 1, 127);
return;
}
CheckStatus(env, status);
}