mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
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:
committed by
Peter Johnson
parent
d322342494
commit
71d0a07e0a
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user