Files
allwpilib/hal/include/HAL/Handles.h
Thad House fc515f4572 Changes HAL Port from a pointer to a handle (#93)
HAL Port is using a special handle, where the module and pin are bit
shifted straight into the handle. This is one of the few special cases
we have, but for the way port is used it is much cleaner and uses much
less memory.  Plus it is generic and not specific to one type.
2016-06-05 15:23:58 -07:00

22 lines
803 B
C

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2016. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <stdint.h>
#define HAL_INVALID_HANDLE 0
#define HAL_HANDLE_INDEX_OUT_OF_RANGE -1
#define HAL_HANDLE_ALREADY_ALLOCATED -2
#define HAL_HANDLE_INVALID_TYPE -3
#define HAL_HANDLE_OUT_OF_HANDLES -4
#define HAL_HANDLE_NEGATIVE_INDEX -5
typedef int32_t HalHandle;
typedef HalHandle HalPortHandle;