mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[hal] Fix PWM allocation channel (#3637)
Previously it showed 31 when 0 was doubly allocated
This commit is contained in:
@@ -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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user