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