From 4ad3a5402620f646c29c110ebaf52a9c084b1c73 Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Thu, 14 Oct 2021 07:28:49 -0700 Subject: [PATCH] [hal] Fix PWM allocation channel (#3637) Previously it showed 31 when 0 was doubly allocated --- hal/src/main/native/athena/PWM.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hal/src/main/native/athena/PWM.cpp b/hal/src/main/native/athena/PWM.cpp index 6bb0fce09c..19a3b83290 100644 --- a/hal/src/main/native/athena/PWM.cpp +++ b/hal/src/main/native/athena/PWM.cpp @@ -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. }