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.
This commit is contained in:
Thad House
2017-01-14 22:59:05 -08:00
committed by Peter Johnson
parent d322342494
commit 71d0a07e0a

View File

@@ -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);