WPILib 2012
WPILibRoboticsLibraryforFRC
|
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2008. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #ifndef __WPI_ERRORS_H__ 00008 #define __WPI_ERRORS_H__ 00009 00010 #ifdef WPI_ERRORS_DEFINE_STRINGS 00011 #define S(label, offset, message) const char *wpi_error_s_##label = message ; 00012 #else 00013 #define S(label, offset, message) extern const char *wpi_error_s_##label; 00014 #endif 00015 00016 /* 00017 * Fatal errors 00018 */ 00019 S(ModuleIndexOutOfRange, -1, "Allocating module that is out of range or not found"); 00020 S(ChannelIndexOutOfRange, -1, "Allocating channel that is out of range"); 00021 S(NotAllocated, -2, "Attempting to free unallocated resource"); 00022 S(ResourceAlreadyAllocated, -3, "Attempted to reuse an allocated resource"); 00023 S(NoAvailableResources, -4, "No available resources to allocate"); 00024 S(NullParameter, -5, "A pointer parameter to a method is NULL"); 00025 S(Timeout, -6, "A timeout has been exceeded"); 00026 S(CompassManufacturerError, -7, "Compass manufacturer doesn't match HiTechnic"); 00027 S(CompassTypeError, -8, "Compass type doesn't match expected type for HiTechnic compass"); 00028 S(IncompatibleMode, -9, "The object is in an incompatible mode"); 00029 S(AnalogTriggerLimitOrderError, -10, "AnalogTrigger limits error. Lower limit > Upper Limit"); 00030 S(AnalogTriggerPulseOutputError, -11, "Attempted to read AnalogTrigger pulse output."); 00031 S(TaskError, -12, "Task can't be started"); 00032 S(TaskIDError, -13, "Task error: Invalid ID."); 00033 S(TaskDeletedError, -14, "Task error: Task already deleted."); 00034 S(TaskOptionsError, -15, "Task error: Invalid options."); 00035 S(TaskMemoryError, -16, "Task can't be started due to insufficient memory."); 00036 S(TaskPriorityError, -17, "Task error: Invalid priority [1-255]."); 00037 S(DriveUninitialized, -18, "RobotDrive not initialized for the C interface"); 00038 S(CompressorNonMatching, -19, "Compressor slot/channel doesn't match previous instance"); 00039 S(CompressorAlreadyDefined, -20, "Creating a second compressor instance"); 00040 S(CompressorUndefined, -21, "Using compressor functions without defining compressor"); 00041 S(InconsistentArrayValueAdded, -22, "When packing data into an array to the dashboard, not all values added were of the same type."); 00042 S(MismatchedComplexTypeClose, -23, "When packing data to the dashboard, a Close for a complex type was called without a matching Open."); 00043 S(DashboardDataOverflow, -24, "When packing data to the dashboard, too much data was packed and the buffer overflowed."); 00044 S(DashboardDataCollision, -25, "The same buffer was used for packing data and for printing."); 00045 S(EnhancedIOMissing, -26, "IO is not attached or Enhanced IO is not enabled."); 00046 S(LineNotOutput, -27, "Cannot SetDigitalOutput for a line not configured for output."); 00047 S(ParameterOutOfRange, -28, "A parameter is out of range."); 00048 S(SPIClockRateTooLow, -29, "SPI clock rate was below the minimum supported"); 00049 S(JaguarVersionError, -30, "Jaguar firmware version error"); 00050 S(NetworkTablesReadError, -40, "Error reading NetworkTables socket"); 00051 S(NetworkTablesBufferFull, -41, "Buffer full writing to NetworkTables socket"); 00052 S(NetworkTablesWrongType, -42, "The wrong type was read from the NetworkTables entry"); 00053 S(NetworkTablesCorrupt, -43, "NetworkTables data stream is corrupt"); 00054 S(SmartDashboardMissingKey, -43, "SmartDashboard data does not exist"); 00055 S(CommandIllegalUse, -50, "Illegal use of Command"); 00056 00057 /* 00058 * Warnings 00059 */ 00060 S(SampleRateTooHigh, 1, "Analog module sample rate is too high"); 00061 S(VoltageOutOfRange, 2, "Voltage to convert to raw value is out of range [-10; 10]"); 00062 S(CompressorTaskError, 3, "Compressor task won't start"); 00063 S(LoopTimingError, 4, "Digital module loop timing is not the expected value"); 00064 S(NonBinaryDigitalValue, 5, "Digital output value is not 0 or 1"); 00065 S(IncorrectBatteryChannel, 6, "Battery measurement channel is not correct value"); 00066 S(BadJoystickIndex, 7, "Joystick index is out of range, should be 1-4"); 00067 S(BadJoystickAxis, 8, "Joystick axis is out of range"); 00068 S(InvalidMotorIndex, 9, "Motor index is out of range, should be 0-3"); 00069 S(DriverStationTaskError, 10, "Driver Station task won't start"); 00070 S(EnhancedIOPWMPeriodOutOfRange, 11, "Driver Station Enhanced IO PWM Output period out of range."); 00071 S(SPIWriteNoMOSI, 12, "Cannot write to SPI port with no MOSI output"); 00072 S(SPIReadNoMISO, 13, "Cannot read from SPI port with no MISO input"); 00073 S(SPIReadNoData, 14, "No data available to read from SPI"); 00074 S(IncompatibleState, 15, "Incompatible State: The operation cannot be completed"); 00075 00076 #undef S 00077 00078 #endif // __WPI_ERRORS_H__