From 71d0a07e0a9623a29f9b784339d2c64feda5f39e Mon Sep 17 00:00:00 2001 From: Thad House Date: Sat, 14 Jan 2017 22:59:05 -0800 Subject: [PATCH] Fixes solenoid allocation error message (#455) The error was NO_AVAILABLE_RESOURCES, which is not the proper error to return. Instead, just return the error directly from the allocation. --- hal/lib/athena/Solenoid.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hal/lib/athena/Solenoid.cpp b/hal/lib/athena/Solenoid.cpp index e0835593c0..8df86646cb 100644 --- a/hal/lib/athena/Solenoid.cpp +++ b/hal/lib/athena/Solenoid.cpp @@ -55,8 +55,7 @@ HAL_SolenoidHandle HAL_InitializeSolenoidPort(HAL_PortHandle portHandle, auto handle = solenoidHandles.Allocate(module * kNumSolenoidChannels + channel, status); - if (handle == HAL_kInvalidHandle) { // out of resources - *status = NO_AVAILABLE_RESOURCES; + if (*status != 0) { return HAL_kInvalidHandle; } auto solenoidPort = solenoidHandles.Get(handle);