blob: 8346fdf5e657762b862c6e5d717735cb9b267f29 [file] [log] [blame]
Brian Silverman26e4e522015-12-17 01:56:40 -05001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008. All Rights Reserved.
3 */
4/* Open Source Software - may be modified and shared by FRC teams. The code */
5/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
6/*----------------------------------------------------------------------------*/
7#pragma once
8
9#include "stdint.h"
10
11#ifdef WPI_ERRORS_DEFINE_STRINGS
12#define S(label, offset, message) \
13 const char * wpi_error_s_##label = message; \
14 const int32_t wpi_error_value_##label = offset
15#else
16#define S(label, offset, message) \
17 extern const char * wpi_error_s_##label; \
18 const int32_t wpi_error_value_##label = offset
19#endif
20
21/*
22 * Fatal errors
23 */
24S(ModuleIndexOutOfRange, -1,
25 "Allocating module that is out of range or not found");
26S(ChannelIndexOutOfRange, -1, "Allocating channel that is out of range");
27S(NotAllocated, -2, "Attempting to free unallocated resource");
28S(ResourceAlreadyAllocated, -3, "Attempted to reuse an allocated resource");
29S(NoAvailableResources, -4, "No available resources to allocate");
30S(NullParameter, -5, "A pointer parameter to a method is nullptr");
31S(Timeout, -6, "A timeout has been exceeded");
32S(CompassManufacturerError, -7, "Compass manufacturer doesn't match HiTechnic");
33S(CompassTypeError, -8,
34 "Compass type doesn't match expected type for HiTechnic compass");
35S(IncompatibleMode, -9, "The object is in an incompatible mode");
36S(AnalogTriggerLimitOrderError, -10,
37 "AnalogTrigger limits error. Lower limit > Upper Limit");
38S(AnalogTriggerPulseOutputError, -11,
39 "Attempted to read AnalogTrigger pulse output.");
40S(TaskError, -12, "Task can't be started");
41S(TaskIDError, -13, "Task error: Invalid ID.");
42S(TaskDeletedError, -14, "Task error: Task already deleted.");
43S(TaskOptionsError, -15, "Task error: Invalid options.");
44S(TaskMemoryError, -16, "Task can't be started due to insufficient memory.");
45S(TaskPriorityError, -17, "Task error: Invalid priority [1-255].");
46S(DriveUninitialized, -18, "RobotDrive not initialized for the C interface");
47S(CompressorNonMatching, -19,
48 "Compressor slot/channel doesn't match previous instance");
49S(CompressorAlreadyDefined, -20, "Creating a second compressor instance");
50S(CompressorUndefined, -21,
51 "Using compressor functions without defining compressor");
52S(InconsistentArrayValueAdded, -22,
53 "When packing data into an array to the dashboard, not all values added were "
54 "of the same type.");
55S(MismatchedComplexTypeClose, -23,
56 "When packing data to the dashboard, a Close for a complex type was called "
57 "without a matching Open.");
58S(DashboardDataOverflow, -24,
59 "When packing data to the dashboard, too much data was packed and the buffer "
60 "overflowed.");
61S(DashboardDataCollision, -25,
62 "The same buffer was used for packing data and for printing.");
63S(EnhancedIOMissing, -26, "IO is not attached or Enhanced IO is not enabled.");
64S(LineNotOutput, -27,
65 "Cannot SetDigitalOutput for a line not configured for output.");
66S(ParameterOutOfRange, -28, "A parameter is out of range.");
67S(SPIClockRateTooLow, -29, "SPI clock rate was below the minimum supported");
68S(JaguarVersionError, -30, "Jaguar firmware version error");
69S(JaguarMessageNotFound, -31, "Jaguar message not found");
70S(NetworkTablesReadError, -40, "Error reading NetworkTables socket");
71S(NetworkTablesBufferFull, -41, "Buffer full writing to NetworkTables socket");
72S(NetworkTablesWrongType, -42,
73 "The wrong type was read from the NetworkTables entry");
74S(NetworkTablesCorrupt, -43, "NetworkTables data stream is corrupt");
75S(SmartDashboardMissingKey, -43, "SmartDashboard data does not exist");
76S(CommandIllegalUse, -50, "Illegal use of Command");
77S(UnsupportedInSimulation, -80, "Unsupported in simulation");
78
79/*
80 * Warnings
81 */
82S(SampleRateTooHigh, 1, "Analog module sample rate is too high");
83S(VoltageOutOfRange, 2,
84 "Voltage to convert to raw value is out of range [-10; 10]");
85S(CompressorTaskError, 3, "Compressor task won't start");
86S(LoopTimingError, 4, "Digital module loop timing is not the expected value");
87S(NonBinaryDigitalValue, 5, "Digital output value is not 0 or 1");
88S(IncorrectBatteryChannel, 6,
89 "Battery measurement channel is not correct value");
90S(BadJoystickIndex, 7, "Joystick index is out of range, should be 0-3");
91S(BadJoystickAxis, 8, "Joystick axis or POV is out of range");
92S(InvalidMotorIndex, 9, "Motor index is out of range, should be 0-3");
93S(DriverStationTaskError, 10, "Driver Station task won't start");
94S(EnhancedIOPWMPeriodOutOfRange, 11,
95 "Driver Station Enhanced IO PWM Output period out of range.");
96S(SPIWriteNoMOSI, 12, "Cannot write to SPI port with no MOSI output");
97S(SPIReadNoMISO, 13, "Cannot read from SPI port with no MISO input");
98S(SPIReadNoData, 14, "No data available to read from SPI");
99S(IncompatibleState, 15,
100 "Incompatible State: The operation cannot be completed");
101
102#undef S