[hal] Fix PWM allocation channel (#3637)

Previously it showed 31 when 0 was doubly allocated
This commit is contained in:
sciencewhiz
2021-10-14 07:28:49 -07:00
committed by GitHub
parent 05e5feac41
commit 4ad3a54026

View File

@@ -98,11 +98,11 @@ HAL_DigitalHandle HAL_InitializePWMPort(HAL_PortHandle portHandle,
if (*status != 0) {
if (port) {
hal::SetLastErrorPreviouslyAllocated(status, "PWM or DIO", channel,
hal::SetLastErrorPreviouslyAllocated(status, "PWM or DIO", origChannel,
port->previousAllocation);
} else {
hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for PWM", 0,
kNumPWMChannels, channel);
kNumPWMChannels, origChannel);
}
return HAL_kInvalidHandle; // failed to allocate. Pass error back.
}