mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Fixes a few bugs in the initial handle implementation (#94)
Failure to check for invalid type on handle creation, and handle type check was broken.
This commit is contained in:
committed by
Peter Johnson
parent
f0d9e19b5c
commit
c85b72b952
@@ -13,6 +13,7 @@
|
||||
namespace hal {
|
||||
HalHandle createHandle(int16_t index, HalHandleEnum handleType) {
|
||||
if (index < 0) return HAL_HANDLE_NEGATIVE_INDEX;
|
||||
if (handleType <= 0 || handleType > 127) return HAL_HANDLE_INVALID_TYPE;
|
||||
// set last 8 bits, then shift to first 8 bits
|
||||
HalHandle handle = handleType;
|
||||
handle = handle << 24;
|
||||
|
||||
Reference in New Issue
Block a user