WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Errors.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7/**
8 * @defgroup hal_errors Error Defines
9 * @ingroup hal_capi
10 * @{
11 */
12
13#define CTR_RxTimeout_MESSAGE "CTRE CAN Receive Timeout"
14#define CTR_TxTimeout_MESSAGE "CTRE CAN Transmit Timeout"
15#define CTR_InvalidParamValue_MESSAGE "CTRE CAN Invalid Parameter"
16#define CTR_UnexpectedArbId_MESSAGE \
17 "CTRE Unexpected Arbitration ID (CAN Node ID)"
18#define CTR_TxFailed_MESSAGE "CTRE CAN Transmit Error"
19#define CTR_SigNotUpdated_MESSAGE "CTRE CAN Signal Not Updated"
20
21#define NiFpga_Status_FifoTimeout_MESSAGE "NIFPGA: FIFO timeout error"
22#define NiFpga_Status_TransferAborted_MESSAGE "NIFPGA: Transfer aborted error"
23#define NiFpga_Status_MemoryFull_MESSAGE \
24 "NIFPGA: Memory Allocation failed, memory full"
25#define NiFpga_Status_SoftwareFault_MESSAGE "NIFPGA: Unexpected software error"
26#define NiFpga_Status_InvalidParameter_MESSAGE "NIFPGA: Invalid Parameter"
27#define NiFpga_Status_ResourceNotFound_MESSAGE "NIFPGA: Resource not found"
28#define NiFpga_Status_ResourceNotInitialized_MESSAGE \
29 "NIFPGA: Resource not initialized"
30#define NiFpga_Status_HardwareFault_MESSAGE "NIFPGA: Hardware Fault"
31#define NiFpga_Status_IrqTimeout_MESSAGE "NIFPGA: Interrupt timeout"
32
33#define ERR_CANSessionMux_InvalidBuffer_MESSAGE "CAN: Invalid Buffer"
34#define ERR_CANSessionMux_MessageNotFound_MESSAGE "CAN: Message not found"
35#define WARN_CANSessionMux_NoToken_MESSAGE "CAN: No token"
36#define ERR_CANSessionMux_NotAllowed_MESSAGE "CAN: Not allowed"
37#define ERR_CANSessionMux_NotInitialized_MESSAGE "CAN: Not initialized"
38#define HAL_WARN_CANSessionMux_TxQueueFull_MESSAGE \
39 "CAN: TX Queue full. Generally caused by a disconnected bus."
40#define HAL_WARN_CANSessionMux_SocketBufferFull_MESSAGE \
41 "CAN: Socket Buffer full. Generally caused by sending too many packets."
42
43#define ERR_FRCSystem_NetCommNotResponding_MESSAGE \
44 "FRCSystem: NetComm not responding"
45#define ERR_FRCSystem_NoDSConnection_MESSAGE \
46 "FRCSystem: No driver station connected"
47
48#define HAL_SUCCESS 0
49
50#define SAMPLE_RATE_TOO_HIGH 1001
51#define SAMPLE_RATE_TOO_HIGH_MESSAGE \
52 "HAL: Analog module sample rate is too high"
53#define VOLTAGE_OUT_OF_RANGE 1002
54#define VOLTAGE_OUT_OF_RANGE_MESSAGE \
55 "HAL: Voltage to convert to raw value is out of range [0; 5]"
56#define LOOP_TIMING_ERROR 1004
57#define LOOP_TIMING_ERROR_MESSAGE \
58 "HAL: Digital module loop timing is not the expected value"
59#define SPI_WRITE_NO_MOSI 1012
60#define SPI_WRITE_NO_MOSI_MESSAGE \
61 "HAL: Cannot write to SPI port with no MOSI output"
62#define SPI_READ_NO_MISO 1013
63#define SPI_READ_NO_MISO_MESSAGE \
64 "HAL: Cannot read from SPI port with no MISO input"
65#define SPI_READ_NO_DATA 1014
66#define SPI_READ_NO_DATA_MESSAGE "HAL: No data available to read from SPI"
67#define INCOMPATIBLE_STATE 1015
68#define INCOMPATIBLE_STATE_MESSAGE \
69 "HAL: Incompatible State: The operation cannot be completed"
70#define NO_AVAILABLE_RESOURCES -1004
71#define NO_AVAILABLE_RESOURCES_MESSAGE "HAL: No available resources to allocate"
72#define NULL_PARAMETER -1005
73#define NULL_PARAMETER_MESSAGE "HAL: A pointer parameter to a method is NULL"
74#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR -1010
75#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE \
76 "HAL: AnalogTrigger limits error. Lower limit > Upper Limit"
77#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR -1011
78#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE \
79 "HAL: Attempted to read AnalogTrigger pulse output."
80#define PARAMETER_OUT_OF_RANGE -1028
81#define PARAMETER_OUT_OF_RANGE_MESSAGE "HAL: A parameter is out of range."
82#define RESOURCE_IS_ALLOCATED -1029
83#define RESOURCE_IS_ALLOCATED_MESSAGE "HAL: Resource already allocated"
84#define RESOURCE_OUT_OF_RANGE -1030
85#define RESOURCE_OUT_OF_RANGE_MESSAGE \
86 "HAL: The requested resource is out of range."
87#define HAL_INVALID_ACCUMULATOR_CHANNEL -1035
88#define HAL_INVALID_ACCUMULATOR_CHANNEL_MESSAGE \
89 "HAL: The requested input is not an accumulator channel"
90#define HAL_COUNTER_NOT_SUPPORTED -1058
91#define HAL_COUNTER_NOT_SUPPORTED_MESSAGE \
92 "HAL: Counter mode not supported for encoder method"
93#define HAL_PWM_SCALE_ERROR -1072
94#define HAL_PWM_SCALE_ERROR_MESSAGE \
95 "HAL: The PWM Scale Factors are out of range"
96#define HAL_HANDLE_ERROR -1098
97#define HAL_HANDLE_ERROR_MESSAGE \
98 "HAL: A handle parameter was passed incorrectly"
99
100#define HAL_LED_CHANNEL_ERROR -1099
101#define HAL_LED_CHANNEL_ERROR_MESSAGE \
102 "HAL: Addressable LEDs only supported on PWM Headers, not MXP or DIO"
103
104#define HAL_INVALID_DMA_ADDITION -1102
105#define HAL_INVALID_DMA_ADDITION_MESSAGE \
106 "HAL_AddDMA() only works before HAL_StartDMA()"
107
108#define HAL_INVALID_DMA_STATE -1103
109#define HAL_INVALID_DMA_STATE_MESSAGE \
110 "HAL_SetPause() only works before HAL_StartDMA()"
111
112#define HAL_SERIAL_PORT_NOT_FOUND -1123
113#define HAL_SERIAL_PORT_NOT_FOUND_MESSAGE \
114 "HAL: The specified serial port device was not found"
115
116#define HAL_SERIAL_PORT_OPEN_ERROR -1124
117#define HAL_SERIAL_PORT_OPEN_ERROR_MESSAGE \
118 "HAL: The serial port could not be opened"
119
120#define HAL_SERIAL_PORT_ERROR -1125
121#define HAL_SERIAL_PORT_ERROR_MESSAGE \
122 "HAL: There was an error on the serial port"
123
124#define HAL_THREAD_PRIORITY_ERROR -1152
125#define HAL_THREAD_PRIORITY_ERROR_MESSAGE \
126 "HAL: Getting or setting the priority of a thread has failed"
127
128#define HAL_THREAD_PRIORITY_RANGE_ERROR -1153
129#define HAL_THREAD_PRIORITY_RANGE_ERROR_MESSAGE \
130 "HAL: The priority requested to be set is invalid"
131
132#define HAL_CAN_TIMEOUT -1154
133#define HAL_CAN_TIMEOUT_MESSAGE "HAL: CAN Receive has Timed Out"
134
135#define HAL_SIM_NOT_SUPPORTED -1155
136#define HAL_SIM_NOT_SUPPORTED_MESSAGE "HAL: Method not supported in sim"
137
138#define HAL_USE_LAST_ERROR -1156
139#define HAL_USE_LAST_ERROR_MESSAGE \
140 "HAL: Use HAL_GetLastError(status) to get last error"
141
142#define HAL_CONSOLE_OUT_ENABLED_ERROR -1157
143#define HAL_CONSOLE_OUT_ENABLED_ERROR_MESSAGE \
144 "HAL: Onboard serial port is requested, but Console Out is enabled. " \
145 "Disable Console Out using imaging tool"
146
147#define HAL_CAN_BUFFER_OVERRUN -35007
148#define HAL_CAN_BUFFER_OVERRUN_MESSAGE \
149 "HAL: CAN Output Buffer Full. Ensure a device is attached"
150
151#define VI_ERROR_SYSTEM_ERROR_MESSAGE "HAL - VISA: System Error"
152#define VI_ERROR_INV_OBJECT_MESSAGE "HAL - VISA: Invalid Object"
153#define VI_ERROR_RSRC_LOCKED_MESSAGE "HAL - VISA: Resource Locked"
154#define VI_ERROR_RSRC_NFOUND_MESSAGE "HAL - VISA: Resource Not Found"
155#define VI_ERROR_INV_RSRC_NAME_MESSAGE "HAL - VISA: Invalid Resource Name"
156#define VI_ERROR_QUEUE_OVERFLOW_MESSAGE "HAL - VISA: Queue Overflow"
157#define VI_ERROR_IO_MESSAGE "HAL - VISA: General IO Error"
158#define VI_ERROR_ASRL_PARITY_MESSAGE "HAL - VISA: Parity Error"
159#define VI_ERROR_ASRL_FRAMING_MESSAGE "HAL - VISA: Framing Error"
160#define VI_ERROR_ASRL_OVERRUN_MESSAGE "HAL - VISA: Buffer Overrun Error"
161#define VI_ERROR_RSRC_BUSY_MESSAGE "HAL - VISA: Resource Busy"
162#define VI_ERROR_INV_PARAMETER_MESSAGE "HAL - VISA: Invalid Parameter"
163/** @} */