mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Handles will be replacing opaque pointers in the HAL for better compatibility and easier error checking. This commits adds the initial resource manangement and definition for handles.
22 lines
817 B
C
22 lines
817 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;
|
|
|
|
enum HalHandleEnum { Undefined = 0, DIO = 1 };
|