[hal] Fix CAN ID validation and reporting for CTRE and REV devices (#7178)

REV: 1-63, 63 devices
CTRE: 0-62, 63 devices
This commit is contained in:
Ryan Blue
2024-10-11 01:06:53 -04:00
committed by GitHub
parent a65f6b94ee
commit fc83d4868c
7 changed files with 30 additions and 16 deletions

View File

@@ -49,7 +49,7 @@ HAL_CTREPCMHandle HAL_InitializeCTREPCM(int32_t module,
pcm->previousAllocation);
} else {
hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for CTRE PCM", 0,
kNumCTREPCMModules, module);
kNumCTREPCMModules - 1, module);
}
return HAL_kInvalidHandle; // failed to allocate. Pass error back.
}