diff --git a/hal/src/main/java/org/wpilib/hardware/hal/HALUtil.java b/hal/src/main/java/org/wpilib/hardware/hal/HALUtil.java index 3b0156a56e..0ed4db49e4 100644 --- a/hal/src/main/java/org/wpilib/hardware/hal/HALUtil.java +++ b/hal/src/main/java/org/wpilib/hardware/hal/HALUtil.java @@ -13,23 +13,14 @@ public final class HALUtil extends JNIWrapper { /** A pointer parameter to a method is NULL. */ public static final int NULL_PARAMETER = -1005; - /** Analog module sample rate is too high. */ - public static final int SAMPLE_RATE_TOO_HIGH = 1001; - /** Voltage to convert to raw value is out of range [0; 5]. */ public static final int VOLTAGE_OUT_OF_RANGE = 1002; - /** Digital module loop timing is not the expected value. */ - public static final int LOOP_TIMING_ERROR = 1004; - /** The operation cannot be completed. */ public static final int INCOMPATIBLE_STATE = 1015; - /** Attempted to read AnalogTrigger pulse output. */ - public static final int ANALOG_TRIGGER_PULSE_OUTPUT_ERROR = -1011; - /** No available resources to allocate. */ - public static final int NO_AVAILABLE_RESOURCES = -104; + public static final int NO_AVAILABLE_RESOURCES = -1004; /** A parameter is out of range. */ public static final int PARAMETER_OUT_OF_RANGE = -1028; diff --git a/hal/src/main/java/org/wpilib/hardware/hal/communication/NIRioStatus.java b/hal/src/main/java/org/wpilib/hardware/hal/communication/NIRioStatus.java deleted file mode 100644 index 75de9ec5f1..0000000000 --- a/hal/src/main/java/org/wpilib/hardware/hal/communication/NIRioStatus.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package org.wpilib.hardware.hal.communication; - -/** NI RIO status. */ -public class NIRioStatus { - /** RIO status offset. */ - public static final int kRioStatusOffset = -63000; - - /** Success. */ - public static final int kRioStatusSuccess = 0; - - /** Buffer invalid size. */ - public static final int kRIOStatusBufferInvalidSize = kRioStatusOffset - 80; - - /** Operation timed out. */ - public static final int kRIOStatusOperationTimedOut = -52007; - - /** Feature not supported. */ - public static final int kRIOStatusFeatureNotSupported = kRioStatusOffset - 193; - - /** Resource not initialized. */ - public static final int kRIOStatusResourceNotInitialized = -52010; - - /** Default constructor. */ - public NIRioStatus() {} -} diff --git a/hal/src/main/native/cpp/jni/HALUtil.cpp b/hal/src/main/native/cpp/jni/HALUtil.cpp index 1c701e94f4..3649264a62 100644 --- a/hal/src/main/native/cpp/jni/HALUtil.cpp +++ b/hal/src/main/native/cpp/jni/HALUtil.cpp @@ -24,13 +24,6 @@ using namespace wpi::util::java; -#define kRioStatusOffset -63000 -#define kRioStatusSuccess 0 -#define kRIOStatusBufferInvalidSize (kRioStatusOffset - 80) -#define kRIOStatusOperationTimedOut -52007 -#define kRIOStatusFeatureNotSupported (kRioStatusOffset - 193) -#define kRIOStatusResourceNotInitialized -52010 - static_assert(org_wpilib_hardware_hal_HALUtil_RUNTIME_ROBORIO == HAL_RUNTIME_ROBORIO); static_assert(org_wpilib_hardware_hal_HALUtil_RUNTIME_ROBORIO_2 == diff --git a/hal/src/main/native/include/wpi/hal/Errors.h b/hal/src/main/native/include/wpi/hal/Errors.h index a86a8d2412..dcffa036a9 100644 --- a/hal/src/main/native/include/wpi/hal/Errors.h +++ b/hal/src/main/native/include/wpi/hal/Errors.h @@ -10,26 +10,6 @@ * @{ */ -#define CTR_RxTimeout_MESSAGE "CTRE CAN Receive Timeout" -#define CTR_TxTimeout_MESSAGE "CTRE CAN Transmit Timeout" -#define CTR_InvalidParamValue_MESSAGE "CTRE CAN Invalid Parameter" -#define CTR_UnexpectedArbId_MESSAGE \ - "CTRE Unexpected Arbitration ID (CAN Node ID)" -#define CTR_TxFailed_MESSAGE "CTRE CAN Transmit Error" -#define CTR_SigNotUpdated_MESSAGE "CTRE CAN Signal Not Updated" - -#define NiFpga_Status_FifoTimeout_MESSAGE "NIFPGA: FIFO timeout error" -#define NiFpga_Status_TransferAborted_MESSAGE "NIFPGA: Transfer aborted error" -#define NiFpga_Status_MemoryFull_MESSAGE \ - "NIFPGA: Memory Allocation failed, memory full" -#define NiFpga_Status_SoftwareFault_MESSAGE "NIFPGA: Unexpected software error" -#define NiFpga_Status_InvalidParameter_MESSAGE "NIFPGA: Invalid Parameter" -#define NiFpga_Status_ResourceNotFound_MESSAGE "NIFPGA: Resource not found" -#define NiFpga_Status_ResourceNotInitialized_MESSAGE \ - "NIFPGA: Resource not initialized" -#define NiFpga_Status_HardwareFault_MESSAGE "NIFPGA: Hardware Fault" -#define NiFpga_Status_IrqTimeout_MESSAGE "NIFPGA: Interrupt timeout" - #define ERR_CANSessionMux_InvalidBuffer_MESSAGE "CAN: Invalid Buffer" #define ERR_CANSessionMux_MessageNotFound_MESSAGE "CAN: Message not found" #define WARN_CANSessionMux_NoToken_MESSAGE "CAN: No token" @@ -42,23 +22,9 @@ #define HAL_SUCCESS 0 -#define SAMPLE_RATE_TOO_HIGH 1001 -#define SAMPLE_RATE_TOO_HIGH_MESSAGE \ - "HAL: Analog module sample rate is too high" #define VOLTAGE_OUT_OF_RANGE 1002 #define VOLTAGE_OUT_OF_RANGE_MESSAGE \ "HAL: Voltage to convert to raw value is out of range [0; 5]" -#define LOOP_TIMING_ERROR 1004 -#define LOOP_TIMING_ERROR_MESSAGE \ - "HAL: Digital module loop timing is not the expected value" -#define SPI_WRITE_NO_MOSI 1012 -#define SPI_WRITE_NO_MOSI_MESSAGE \ - "HAL: Cannot write to SPI port with no MOSI output" -#define SPI_READ_NO_MISO 1013 -#define SPI_READ_NO_MISO_MESSAGE \ - "HAL: Cannot read from SPI port with no MISO input" -#define SPI_READ_NO_DATA 1014 -#define SPI_READ_NO_DATA_MESSAGE "HAL: No data available to read from SPI" #define INCOMPATIBLE_STATE 1015 #define INCOMPATIBLE_STATE_MESSAGE \ "HAL: Incompatible State: The operation cannot be completed" @@ -66,12 +32,6 @@ #define NO_AVAILABLE_RESOURCES_MESSAGE "HAL: No available resources to allocate" #define NULL_PARAMETER -1005 #define NULL_PARAMETER_MESSAGE "HAL: A pointer parameter to a method is NULL" -#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR -1010 -#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE \ - "HAL: AnalogTrigger limits error. Lower limit > Upper Limit" -#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR -1011 -#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE \ - "HAL: Attempted to read AnalogTrigger pulse output." #define PARAMETER_OUT_OF_RANGE -1028 #define PARAMETER_OUT_OF_RANGE_MESSAGE "HAL: A parameter is out of range." #define RESOURCE_IS_ALLOCATED -1029 @@ -79,31 +39,13 @@ #define RESOURCE_OUT_OF_RANGE -1030 #define RESOURCE_OUT_OF_RANGE_MESSAGE \ "HAL: The requested resource is out of range." -#define HAL_INVALID_ACCUMULATOR_CHANNEL -1035 -#define HAL_INVALID_ACCUMULATOR_CHANNEL_MESSAGE \ - "HAL: The requested input is not an accumulator channel" #define HAL_COUNTER_NOT_SUPPORTED -1058 #define HAL_COUNTER_NOT_SUPPORTED_MESSAGE \ "HAL: Counter mode not supported for encoder method" -#define HAL_PWM_SCALE_ERROR -1072 -#define HAL_PWM_SCALE_ERROR_MESSAGE \ - "HAL: The PWM Scale Factors are out of range" #define HAL_HANDLE_ERROR -1098 #define HAL_HANDLE_ERROR_MESSAGE \ "HAL: A handle parameter was passed incorrectly" -#define HAL_LED_CHANNEL_ERROR -1099 -#define HAL_LED_CHANNEL_ERROR_MESSAGE \ - "HAL: Addressable LEDs only supported on PWM Headers, not MXP or DIO" - -#define HAL_INVALID_DMA_ADDITION -1102 -#define HAL_INVALID_DMA_ADDITION_MESSAGE \ - "HAL_AddDMA() only works before HAL_StartDMA()" - -#define HAL_INVALID_DMA_STATE -1103 -#define HAL_INVALID_DMA_STATE_MESSAGE \ - "HAL_SetPause() only works before HAL_StartDMA()" - #define HAL_SERIAL_PORT_NOT_FOUND -1123 #define HAL_SERIAL_PORT_NOT_FOUND_MESSAGE \ "HAL: The specified serial port device was not found" @@ -134,25 +76,8 @@ #define HAL_USE_LAST_ERROR_MESSAGE \ "HAL: Use HAL_GetLastError(status) to get last error" -#define HAL_CONSOLE_OUT_ENABLED_ERROR -1157 -#define HAL_CONSOLE_OUT_ENABLED_ERROR_MESSAGE \ - "HAL: Onboard serial port is requested, but Console Out is enabled. " \ - "Disable Console Out using imaging tool" - #define HAL_CAN_BUFFER_OVERRUN -35007 #define HAL_CAN_BUFFER_OVERRUN_MESSAGE \ "HAL: CAN Output Buffer Full. Ensure a device is attached" -#define VI_ERROR_SYSTEM_ERROR_MESSAGE "HAL - VISA: System Error" -#define VI_ERROR_INV_OBJECT_MESSAGE "HAL - VISA: Invalid Object" -#define VI_ERROR_RSRC_LOCKED_MESSAGE "HAL - VISA: Resource Locked" -#define VI_ERROR_RSRC_NFOUND_MESSAGE "HAL - VISA: Resource Not Found" -#define VI_ERROR_INV_RSRC_NAME_MESSAGE "HAL - VISA: Invalid Resource Name" -#define VI_ERROR_QUEUE_OVERFLOW_MESSAGE "HAL - VISA: Queue Overflow" -#define VI_ERROR_IO_MESSAGE "HAL - VISA: General IO Error" -#define VI_ERROR_ASRL_PARITY_MESSAGE "HAL - VISA: Parity Error" -#define VI_ERROR_ASRL_FRAMING_MESSAGE "HAL - VISA: Framing Error" -#define VI_ERROR_ASRL_OVERRUN_MESSAGE "HAL - VISA: Buffer Overrun Error" -#define VI_ERROR_RSRC_BUSY_MESSAGE "HAL - VISA: Resource Busy" -#define VI_ERROR_INV_PARAMETER_MESSAGE "HAL - VISA: Invalid Parameter" /** @} */ diff --git a/hal/src/main/native/sim/ErrorsInternal.h b/hal/src/main/native/sim/ErrorsInternal.h deleted file mode 100644 index 42d15606ad..0000000000 --- a/hal/src/main/native/sim/ErrorsInternal.h +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include - -enum CTR_Code { - CTR_OKAY, // No Error - Function executed as expected - CTR_RxTimeout, // CAN frame has not been received within specified period of - // time. - CTR_TxTimeout, // Not used. - CTR_InvalidParamValue, // Caller passed an invalid param - CTR_UnexpectedArbId, // Specified CAN Id is invalid. - CTR_TxFailed, // Could not transmit the CAN frame. - CTR_SigNotUpdated, // Have not received an value response for signal. - CTR_BufferFull, // Caller attempted to insert data into a buffer that is - // full. -}; - -// VISA Error -#define _VI_ERROR (-2147483647L - 1) -#define VI_ERROR_SYSTEM_ERROR (_VI_ERROR + 0x3FFF0000L) -#define VI_ERROR_INV_OBJECT (_VI_ERROR + 0x3FFF000EL) -#define VI_ERROR_RSRC_LOCKED (_VI_ERROR + 0x3FFF000FL) -#define VI_ERROR_INV_EXPR (_VI_ERROR + 0x3FFF0010L) -#define VI_ERROR_RSRC_NFOUND (_VI_ERROR + 0x3FFF0011L) -#define VI_ERROR_INV_RSRC_NAME (_VI_ERROR + 0x3FFF0012L) -#define VI_ERROR_INV_ACC_MODE (_VI_ERROR + 0x3FFF0013L) -#define VI_ERROR_TMO (_VI_ERROR + 0x3FFF0015L) -#define VI_ERROR_CLOSING_FAILED (_VI_ERROR + 0x3FFF0016L) -#define VI_ERROR_INV_DEGREE (_VI_ERROR + 0x3FFF001BL) -#define VI_ERROR_INV_JOB_ID (_VI_ERROR + 0x3FFF001CL) -#define VI_ERROR_NSUP_ATTR (_VI_ERROR + 0x3FFF001DL) -#define VI_ERROR_NSUP_ATTR_STATE (_VI_ERROR + 0x3FFF001EL) -#define VI_ERROR_ATTR_READONLY (_VI_ERROR + 0x3FFF001FL) -#define VI_ERROR_INV_LOCK_TYPE (_VI_ERROR + 0x3FFF0020L) -#define VI_ERROR_INV_ACCESS_KEY (_VI_ERROR + 0x3FFF0021L) -#define VI_ERROR_INV_EVENT (_VI_ERROR + 0x3FFF0026L) -#define VI_ERROR_INV_MECH (_VI_ERROR + 0x3FFF0027L) -#define VI_ERROR_HNDLR_NINSTALLED (_VI_ERROR + 0x3FFF0028L) -#define VI_ERROR_INV_HNDLR_REF (_VI_ERROR + 0x3FFF0029L) -#define VI_ERROR_INV_CONTEXT (_VI_ERROR + 0x3FFF002AL) -#define VI_ERROR_QUEUE_OVERFLOW (_VI_ERROR + 0x3FFF002DL) -#define VI_ERROR_NENABLED (_VI_ERROR + 0x3FFF002FL) -#define VI_ERROR_ABORT (_VI_ERROR + 0x3FFF0030L) -#define VI_ERROR_RAW_WR_PROT_VIOL (_VI_ERROR + 0x3FFF0034L) -#define VI_ERROR_RAW_RD_PROT_VIOL (_VI_ERROR + 0x3FFF0035L) -#define VI_ERROR_OUTP_PROT_VIOL (_VI_ERROR + 0x3FFF0036L) -#define VI_ERROR_INP_PROT_VIOL (_VI_ERROR + 0x3FFF0037L) -#define VI_ERROR_BERR (_VI_ERROR + 0x3FFF0038L) -#define VI_ERROR_IN_PROGRESS (_VI_ERROR + 0x3FFF0039L) -#define VI_ERROR_INV_SETUP (_VI_ERROR + 0x3FFF003AL) -#define VI_ERROR_QUEUE_ERROR (_VI_ERROR + 0x3FFF003BL) -#define VI_ERROR_ALLOC (_VI_ERROR + 0x3FFF003CL) -#define VI_ERROR_INV_MASK (_VI_ERROR + 0x3FFF003DL) -#define VI_ERROR_IO (_VI_ERROR + 0x3FFF003EL) -#define VI_ERROR_INV_FMT (_VI_ERROR + 0x3FFF003FL) -#define VI_ERROR_NSUP_FMT (_VI_ERROR + 0x3FFF0041L) -#define VI_ERROR_LINE_IN_USE (_VI_ERROR + 0x3FFF0042L) -#define VI_ERROR_NSUP_MODE (_VI_ERROR + 0x3FFF0046L) -#define VI_ERROR_SRQ_NOCCURRED (_VI_ERROR + 0x3FFF004AL) -#define VI_ERROR_INV_SPACE (_VI_ERROR + 0x3FFF004EL) -#define VI_ERROR_INV_OFFSET (_VI_ERROR + 0x3FFF0051L) -#define VI_ERROR_INV_WIDTH (_VI_ERROR + 0x3FFF0052L) -#define VI_ERROR_NSUP_OFFSET (_VI_ERROR + 0x3FFF0054L) -#define VI_ERROR_NSUP_VAR_WIDTH (_VI_ERROR + 0x3FFF0055L) -#define VI_ERROR_WINDOW_NMAPPED (_VI_ERROR + 0x3FFF0057L) -#define VI_ERROR_RESP_PENDING (_VI_ERROR + 0x3FFF0059L) -#define VI_ERROR_NLISTENERS (_VI_ERROR + 0x3FFF005FL) -#define VI_ERROR_NCIC (_VI_ERROR + 0x3FFF0060L) -#define VI_ERROR_NSYS_CNTLR (_VI_ERROR + 0x3FFF0061L) -#define VI_ERROR_NSUP_OPER (_VI_ERROR + 0x3FFF0067L) -#define VI_ERROR_INTR_PENDING (_VI_ERROR + 0x3FFF0068L) -#define VI_ERROR_ASRL_PARITY (_VI_ERROR + 0x3FFF006AL) -#define VI_ERROR_ASRL_FRAMING (_VI_ERROR + 0x3FFF006BL) -#define VI_ERROR_ASRL_OVERRUN (_VI_ERROR + 0x3FFF006CL) -#define VI_ERROR_TRIG_NMAPPED (_VI_ERROR + 0x3FFF006EL) -#define VI_ERROR_NSUP_ALIGN_OFFSET (_VI_ERROR + 0x3FFF0070L) -#define VI_ERROR_USER_BUF (_VI_ERROR + 0x3FFF0071L) -#define VI_ERROR_RSRC_BUSY (_VI_ERROR + 0x3FFF0072L) -#define VI_ERROR_NSUP_WIDTH (_VI_ERROR + 0x3FFF0076L) -#define VI_ERROR_INV_PARAMETER (_VI_ERROR + 0x3FFF0078L) -#define VI_ERROR_INV_PROT (_VI_ERROR + 0x3FFF0079L) -#define VI_ERROR_INV_SIZE (_VI_ERROR + 0x3FFF007BL) -#define VI_ERROR_WINDOW_MAPPED (_VI_ERROR + 0x3FFF0080L) -#define VI_ERROR_NIMPL_OPER (_VI_ERROR + 0x3FFF0081L) -#define VI_ERROR_INV_LENGTH (_VI_ERROR + 0x3FFF0083L) -#define VI_ERROR_INV_MODE (_VI_ERROR + 0x3FFF0091L) -#define VI_ERROR_SESN_NLOCKED (_VI_ERROR + 0x3FFF009CL) -#define VI_ERROR_MEM_NSHARED (_VI_ERROR + 0x3FFF009DL) -#define VI_ERROR_LIBRARY_NFOUND (_VI_ERROR + 0x3FFF009EL) -#define VI_ERROR_NSUP_INTR (_VI_ERROR + 0x3FFF009FL) -#define VI_ERROR_INV_LINE (_VI_ERROR + 0x3FFF00A0L) -#define VI_ERROR_FILE_ACCESS (_VI_ERROR + 0x3FFF00A1L) -#define VI_ERROR_FILE_IO (_VI_ERROR + 0x3FFF00A2L) -#define VI_ERROR_NSUP_LINE (_VI_ERROR + 0x3FFF00A3L) -#define VI_ERROR_NSUP_MECH (_VI_ERROR + 0x3FFF00A4L) -#define VI_ERROR_INTF_NUM_NCONFIG (_VI_ERROR + 0x3FFF00A5L) -#define VI_ERROR_CONN_LOST (_VI_ERROR + 0x3FFF00A6L) -#define VI_ERROR_MACHINE_NAVAIL (_VI_ERROR + 0x3FFF00A7L) -#define VI_ERROR_NPERMISSION (_VI_ERROR + 0x3FFF00A8L) - -// FPGA Errors - -/** - * Represents the resulting status of a function call through its return value. - * 0 is success, negative values are errors, and positive values are warnings. - */ -using NiFpga_Status = int32_t; // NOLINT - -/** - * No errors or warnings. - */ -constexpr NiFpga_Status NiFpga_Status_Success = 0; - -/** - * The timeout expired before the FIFO operation could complete. - */ -constexpr NiFpga_Status NiFpga_Status_FifoTimeout = -50400; - -/** - * No transfer is in progress because the transfer was aborted by the client. - * The operation could not be completed as specified. - */ -constexpr NiFpga_Status NiFpga_Status_TransferAborted = -50405; - -/** - * A memory allocation failed. Try again after rebooting. - */ -constexpr NiFpga_Status NiFpga_Status_MemoryFull = -52000; - -/** - * An unexpected software error occurred. - */ -constexpr NiFpga_Status NiFpga_Status_SoftwareFault = -52003; - -/** - * A parameter to a function was not valid. This could be a NULL pointer, a bad - * value, etc. - */ -constexpr NiFpga_Status NiFpga_Status_InvalidParameter = -52005; - -/** - * A required resource was not found. The NiFpga.* library, the RIO resource, or - * some other resource may be missing. - */ -constexpr NiFpga_Status NiFpga_Status_ResourceNotFound = -52006; - -/** - * A required resource was not properly initialized. This could occur if - * NiFpga_Initialize was not called or a required NiFpga_IrqContext was not - * reserved. - */ -constexpr NiFpga_Status NiFpga_Status_ResourceNotInitialized = -52010; - -/** - * A hardware failure has occurred. The operation could not be completed as - * specified. - */ -constexpr NiFpga_Status NiFpga_Status_HardwareFault = -52018; - -/** - * The FPGA is already running. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaAlreadyRunning = -61003; - -/** - * An error occurred downloading the VI to the FPGA device. Verify that - * the target is connected and powered and that the resource of the target - * is properly configured. - */ -constexpr NiFpga_Status NiFpga_Status_DownloadError = -61018; - -/** - * The bitfile was not compiled for the specified resource's device type. - */ -constexpr NiFpga_Status NiFpga_Status_DeviceTypeMismatch = -61024; - -/** - * An error was detected in the communication between the host computer and the - * FPGA target. - */ -constexpr NiFpga_Status NiFpga_Status_CommunicationTimeout = -61046; - -/** - * The timeout expired before any of the IRQs were asserted. - */ -constexpr NiFpga_Status NiFpga_Status_IrqTimeout = -61060; - -/** - * The specified bitfile is invalid or corrupt. - */ -constexpr NiFpga_Status NiFpga_Status_CorruptBitfile = -61070; - -/** - * The requested FIFO depth is invalid. It is either 0 or an amount not - * supported by the hardware. - */ -constexpr NiFpga_Status NiFpga_Status_BadDepth = -61072; - -/** - * The number of FIFO elements is invalid. Either the number is greater than the - * depth of the host memory DMA FIFO, or more elements were requested for - * release than had been acquired. - */ -constexpr NiFpga_Status NiFpga_Status_BadReadWriteCount = -61073; - -/** - * A hardware clocking error occurred. A derived clock lost lock with its base - * clock during the execution of the LabVIEW FPGA VI. If any base clocks with - * derived clocks are referencing an external source, make sure that the - * external source is connected and within the supported frequency, jitter, - * accuracy, duty cycle, and voltage specifications. Also verify that the - * characteristics of the base clock match the configuration specified in the - * FPGA Base Clock Properties. If all base clocks with derived clocks are - * generated from free-running, on-board sources, please contact National - * Instruments technical support at ni.com/support. - */ -constexpr NiFpga_Status NiFpga_Status_ClockLostLock = -61083; - -/** - * The operation could not be performed because the FPGA is busy. Stop all - * activities on the FPGA before requesting this operation. If the target is in - * Scan Interface programming mode, put it in FPGA Interface programming mode. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaBusy = -61141; - -/** - * The operation could not be performed because the FPGA is busy operating in - * FPGA Interface C API mode. Stop all activities on the FPGA before requesting - * this operation. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterfaceCApi = -61200; - -/** - * The chassis is in Scan Interface programming mode. In order to run FPGA VIs, - * you must go to the chassis properties page, select FPGA programming mode, and - * deploy settings. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaBusyScanInterface = -61201; - -/** - * The operation could not be performed because the FPGA is busy operating in - * FPGA Interface mode. Stop all activities on the FPGA before requesting this - * operation. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterface = -61202; - -/** - * The operation could not be performed because the FPGA is busy operating in - * Interactive mode. Stop all activities on the FPGA before requesting this - * operation. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaBusyInteractive = -61203; - -/** - * The operation could not be performed because the FPGA is busy operating in - * Emulation mode. Stop all activities on the FPGA before requesting this - * operation. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaBusyEmulation = -61204; - -/** - * LabVIEW FPGA does not support the Reset method for bitfiles that allow - * removal of implicit enable signals in single-cycle Timed Loops. - */ -constexpr NiFpga_Status NiFpga_Status_ResetCalledWithImplicitEnableRemoval = - -61211; - -/** - * LabVIEW FPGA does not support the Abort method for bitfiles that allow - * removal of implicit enable signals in single-cycle Timed Loops. - */ -constexpr NiFpga_Status NiFpga_Status_AbortCalledWithImplicitEnableRemoval = - -61212; - -/** - * LabVIEW FPGA does not support Close and Reset if Last Reference for bitfiles - * that allow removal of implicit enable signals in single-cycle Timed Loops. - * Pass the NiFpga_CloseAttribute_NoResetIfLastSession attribute to NiFpga_Close - * instead of 0. - */ -constexpr NiFpga_Status - NiFpga_Status_CloseAndResetCalledWithImplicitEnableRemoval = -61213; - -/** - * For bitfiles that allow removal of implicit enable signals in single-cycle - * Timed Loops, LabVIEW FPGA does not support this method prior to running the - * bitfile. - */ -constexpr NiFpga_Status NiFpga_Status_ImplicitEnableRemovalButNotYetRun = - -61214; - -/** - * Bitfiles that allow removal of implicit enable signals in single-cycle Timed - * Loops can run only once. Download the bitfile again before re-running the VI. - */ -constexpr NiFpga_Status - NiFpga_Status_RunAfterStoppedCalledWithImplicitEnableRemoval = -61215; - -/** - * A gated clock has violated the handshaking protocol. If you are using - * external gated clocks, ensure that they follow the required clock gating - * protocol. If you are generating your clocks internally, please contact - * National Instruments Technical Support. - */ -constexpr NiFpga_Status NiFpga_Status_GatedClockHandshakingViolation = -61216; - -/** - * The number of elements requested must be less than or equal to the number of - * unacquired elements left in the host memory DMA FIFO. There are currently - * fewer unacquired elements left in the FIFO than are being requested. Release - * some acquired elements before acquiring more elements. - */ -constexpr NiFpga_Status NiFpga_Status_ElementsNotPermissibleToBeAcquired = - -61219; - -/** - * The operation could not be performed because the FPGA is in configuration or - * discovery mode. Wait for configuration or discovery to complete and retry - * your operation. - */ -constexpr NiFpga_Status NiFpga_Status_FpgaBusyConfiguration = -61252; - -/** - * An unexpected internal error occurred. - */ -constexpr NiFpga_Status NiFpga_Status_InternalError = -61499; - -/** - * The NI-RIO driver was unable to allocate memory for a FIFO. This can happen - * when the combined depth of all DMA FIFOs exceeds the maximum depth for the - * controller, or when the controller runs out of system memory. You may be able - * to reconfigure the controller with a greater maximum FIFO depth. For more - * information, refer to the NI KnowledgeBase article 65OF2ERQ. - */ -constexpr NiFpga_Status NiFpga_Status_TotalDmaFifoDepthExceeded = -63003; - -/** - * Access to the remote system was denied. Use MAX to check the Remote Device - * Access settings under Software>>NI-RIO>>NI-RIO Settings on the remote system. - */ -constexpr NiFpga_Status NiFpga_Status_AccessDenied = -63033; - -/** - * The NI-RIO software on the host is not compatible with the software on the - * target. Upgrade the NI-RIO software on the host in order to connect to this - * target. - */ -constexpr NiFpga_Status NiFpga_Status_HostVersionMismatch = -63038; - -/** - * A connection could not be established to the specified remote device. Ensure - * that the device is on and accessible over the network, that NI-RIO software - * is installed, and that the RIO server is running and properly configured. - */ -constexpr NiFpga_Status NiFpga_Status_RpcConnectionError = -63040; - -/** - * The RPC session is invalid. The target may have reset or been rebooted. Check - * the network connection and retry the operation. - */ -constexpr NiFpga_Status NiFpga_Status_RpcSessionError = -63043; - -/** - * The operation could not complete because another session is accessing the - * FIFO. Close the other session and retry. - */ -constexpr NiFpga_Status NiFpga_Status_FifoReserved = -63082; - -/** - * A Configure FIFO, Stop FIFO, Read FIFO, or Write FIFO function was called - * while the host had acquired elements of the FIFO. Release all acquired - * elements before configuring, stopping, reading, or writing. - */ -constexpr NiFpga_Status NiFpga_Status_FifoElementsCurrentlyAcquired = -63083; - -/** - * A function was called using a misaligned address. The address must be a - * multiple of the size of the datatype. - */ -constexpr NiFpga_Status NiFpga_Status_MisalignedAccess = -63084; - -/** - * The FPGA Read/Write Control Function is accessing a control or indicator - * with data that exceeds the maximum size supported on the current target. - * Refer to the hardware documentation for the limitations on data types for - * this target. - */ -constexpr NiFpga_Status NiFpga_Status_ControlOrIndicatorTooLarge = -63085; - -/** - * A valid .lvbitx bitfile is required. If you are using a valid .lvbitx - * bitfile, the bitfile may not be compatible with the software you are using. - * Determine which version of LabVIEW was used to make the bitfile, update your - * software to that version or later, and try again. - */ -constexpr NiFpga_Status NiFpga_Status_BitfileReadError = -63101; - -/** - * The specified signature does not match the signature of the bitfile. If the - * bitfile has been recompiled, regenerate the C API and rebuild the - * application. - */ -constexpr NiFpga_Status NiFpga_Status_SignatureMismatch = -63106; - -/** - * The bitfile you are trying to use is incompatible with the version - * of NI-RIO installed on the target and/or host. Update the version - * of NI-RIO on the target and/or host to the same version (or later) - * used to compile the bitfile. Alternatively, recompile the bitfile - * with the same version of NI-RIO that is currently installed on the - * target and/or host. - */ -constexpr NiFpga_Status NiFpga_Status_IncompatibleBitfile = -63107; - -/** - * Either the supplied resource name is invalid as a RIO resource name, or the - * device was not found. Use MAX to find the proper resource name for the - * intended device. - */ -constexpr NiFpga_Status NiFpga_Status_InvalidResourceName = -63192; - -/** - * The requested feature is not supported. - */ -constexpr NiFpga_Status NiFpga_Status_FeatureNotSupported = -63193; - -/** - * The NI-RIO software on the target system is not compatible with this - * software. Upgrade the NI-RIO software on the target system. - */ -constexpr NiFpga_Status NiFpga_Status_VersionMismatch = -63194; - -/** - * The session is invalid or has been closed. - */ -constexpr NiFpga_Status NiFpga_Status_InvalidSession = -63195; - -/** - * The maximum number of open FPGA sessions has been reached. Close some open - * sessions. - */ -constexpr NiFpga_Status NiFpga_Status_OutOfHandles = -63198; diff --git a/hal/src/main/native/sim/HAL.cpp b/hal/src/main/native/sim/HAL.cpp index a354004ea5..d41559fa88 100644 --- a/hal/src/main/native/sim/HAL.cpp +++ b/hal/src/main/native/sim/HAL.cpp @@ -20,7 +20,6 @@ NtQueryTimerResolution(PULONG MinimumResolution, PULONG MaximumResolution, PULONG CurrentResolution); #endif // _WIN32 -#include "ErrorsInternal.h" #include "HALInitializer.hpp" #include "MockHooksInternal.hpp" #include "mockdata/RoboRioDataInternal.hpp" @@ -117,48 +116,8 @@ const char* HAL_GetErrorMessage(int32_t code) { switch (code) { case 0: return ""; - case CTR_RxTimeout: - return CTR_RxTimeout_MESSAGE; - case CTR_TxTimeout: - return CTR_TxTimeout_MESSAGE; - case CTR_InvalidParamValue: - return CTR_InvalidParamValue_MESSAGE; - case CTR_UnexpectedArbId: - return CTR_UnexpectedArbId_MESSAGE; - case CTR_TxFailed: - return CTR_TxFailed_MESSAGE; - case CTR_SigNotUpdated: - return CTR_SigNotUpdated_MESSAGE; - case NiFpga_Status_FifoTimeout: - return NiFpga_Status_FifoTimeout_MESSAGE; - case NiFpga_Status_TransferAborted: - return NiFpga_Status_TransferAborted_MESSAGE; - case NiFpga_Status_MemoryFull: - return NiFpga_Status_MemoryFull_MESSAGE; - case NiFpga_Status_SoftwareFault: - return NiFpga_Status_SoftwareFault_MESSAGE; - case NiFpga_Status_InvalidParameter: - return NiFpga_Status_InvalidParameter_MESSAGE; - case NiFpga_Status_ResourceNotFound: - return NiFpga_Status_ResourceNotFound_MESSAGE; - case NiFpga_Status_ResourceNotInitialized: - return NiFpga_Status_ResourceNotInitialized_MESSAGE; - case NiFpga_Status_HardwareFault: - return NiFpga_Status_HardwareFault_MESSAGE; - case NiFpga_Status_IrqTimeout: - return NiFpga_Status_IrqTimeout_MESSAGE; - case SAMPLE_RATE_TOO_HIGH: - return SAMPLE_RATE_TOO_HIGH_MESSAGE; case VOLTAGE_OUT_OF_RANGE: return VOLTAGE_OUT_OF_RANGE_MESSAGE; - case LOOP_TIMING_ERROR: - return LOOP_TIMING_ERROR_MESSAGE; - case SPI_WRITE_NO_MOSI: - return SPI_WRITE_NO_MOSI_MESSAGE; - case SPI_READ_NO_MISO: - return SPI_READ_NO_MISO_MESSAGE; - case SPI_READ_NO_DATA: - return SPI_READ_NO_DATA_MESSAGE; case INCOMPATIBLE_STATE: return INCOMPATIBLE_STATE_MESSAGE; case NO_AVAILABLE_RESOURCES: @@ -167,16 +126,10 @@ const char* HAL_GetErrorMessage(int32_t code) { return RESOURCE_IS_ALLOCATED_MESSAGE; case RESOURCE_OUT_OF_RANGE: return RESOURCE_OUT_OF_RANGE_MESSAGE; - case HAL_INVALID_ACCUMULATOR_CHANNEL: - return HAL_INVALID_ACCUMULATOR_CHANNEL_MESSAGE; case HAL_HANDLE_ERROR: return HAL_HANDLE_ERROR_MESSAGE; case NULL_PARAMETER: return NULL_PARAMETER_MESSAGE; - case ANALOG_TRIGGER_LIMIT_ORDER_ERROR: - return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE; - case ANALOG_TRIGGER_PULSE_OUTPUT_ERROR: - return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE; case PARAMETER_OUT_OF_RANGE: return PARAMETER_OUT_OF_RANGE_MESSAGE; case HAL_COUNTER_NOT_SUPPORTED: @@ -191,44 +144,14 @@ const char* HAL_GetErrorMessage(int32_t code) { return ERR_CANSessionMux_NotAllowed_MESSAGE; case HAL_ERR_CANSessionMux_NotInitialized: return ERR_CANSessionMux_NotInitialized_MESSAGE; - case VI_ERROR_SYSTEM_ERROR: - return VI_ERROR_SYSTEM_ERROR_MESSAGE; - case VI_ERROR_INV_OBJECT: - return VI_ERROR_INV_OBJECT_MESSAGE; - case VI_ERROR_RSRC_LOCKED: - return VI_ERROR_RSRC_LOCKED_MESSAGE; - case VI_ERROR_RSRC_NFOUND: - return VI_ERROR_RSRC_NFOUND_MESSAGE; - case VI_ERROR_INV_RSRC_NAME: - return VI_ERROR_INV_RSRC_NAME_MESSAGE; - case VI_ERROR_QUEUE_OVERFLOW: - return VI_ERROR_QUEUE_OVERFLOW_MESSAGE; - case VI_ERROR_IO: - return VI_ERROR_IO_MESSAGE; - case VI_ERROR_ASRL_PARITY: - return VI_ERROR_ASRL_PARITY_MESSAGE; - case VI_ERROR_ASRL_FRAMING: - return VI_ERROR_ASRL_FRAMING_MESSAGE; - case VI_ERROR_ASRL_OVERRUN: - return VI_ERROR_ASRL_OVERRUN_MESSAGE; - case VI_ERROR_RSRC_BUSY: - return VI_ERROR_RSRC_BUSY_MESSAGE; - case VI_ERROR_INV_PARAMETER: - return VI_ERROR_INV_PARAMETER_MESSAGE; - case HAL_PWM_SCALE_ERROR: - return HAL_PWM_SCALE_ERROR_MESSAGE; case HAL_CAN_TIMEOUT: return HAL_CAN_TIMEOUT_MESSAGE; case HAL_SIM_NOT_SUPPORTED: return HAL_SIM_NOT_SUPPORTED_MESSAGE; case HAL_CAN_BUFFER_OVERRUN: return HAL_CAN_BUFFER_OVERRUN_MESSAGE; - case HAL_LED_CHANNEL_ERROR: - return HAL_LED_CHANNEL_ERROR_MESSAGE; case HAL_USE_LAST_ERROR: return HAL_USE_LAST_ERROR_MESSAGE; - case HAL_CONSOLE_OUT_ENABLED_ERROR: - return HAL_CONSOLE_OUT_ENABLED_ERROR_MESSAGE; default: return "Unknown error status"; } diff --git a/hal/src/main/native/systemcore/HAL.cpp b/hal/src/main/native/systemcore/HAL.cpp index 3b4e8035ce..00cfa90f8e 100644 --- a/hal/src/main/native/systemcore/HAL.cpp +++ b/hal/src/main/native/systemcore/HAL.cpp @@ -76,18 +76,8 @@ const char* HAL_GetErrorMessage(int32_t code) { switch (code) { case 0: return ""; - case SAMPLE_RATE_TOO_HIGH: - return SAMPLE_RATE_TOO_HIGH_MESSAGE; case VOLTAGE_OUT_OF_RANGE: return VOLTAGE_OUT_OF_RANGE_MESSAGE; - case LOOP_TIMING_ERROR: - return LOOP_TIMING_ERROR_MESSAGE; - case SPI_WRITE_NO_MOSI: - return SPI_WRITE_NO_MOSI_MESSAGE; - case SPI_READ_NO_MISO: - return SPI_READ_NO_MISO_MESSAGE; - case SPI_READ_NO_DATA: - return SPI_READ_NO_DATA_MESSAGE; case INCOMPATIBLE_STATE: return INCOMPATIBLE_STATE_MESSAGE; case NO_AVAILABLE_RESOURCES: @@ -96,16 +86,10 @@ const char* HAL_GetErrorMessage(int32_t code) { return RESOURCE_IS_ALLOCATED_MESSAGE; case RESOURCE_OUT_OF_RANGE: return RESOURCE_OUT_OF_RANGE_MESSAGE; - case HAL_INVALID_ACCUMULATOR_CHANNEL: - return HAL_INVALID_ACCUMULATOR_CHANNEL_MESSAGE; case HAL_HANDLE_ERROR: return HAL_HANDLE_ERROR_MESSAGE; case NULL_PARAMETER: return NULL_PARAMETER_MESSAGE; - case ANALOG_TRIGGER_LIMIT_ORDER_ERROR: - return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE; - case ANALOG_TRIGGER_PULSE_OUTPUT_ERROR: - return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE; case PARAMETER_OUT_OF_RANGE: return PARAMETER_OUT_OF_RANGE_MESSAGE; case HAL_COUNTER_NOT_SUPPORTED: @@ -124,8 +108,6 @@ const char* HAL_GetErrorMessage(int32_t code) { return HAL_WARN_CANSessionMux_TxQueueFull_MESSAGE; case HAL_WARN_CANSessionMux_SocketBufferFull: return HAL_WARN_CANSessionMux_SocketBufferFull_MESSAGE; - case HAL_PWM_SCALE_ERROR: - return HAL_PWM_SCALE_ERROR_MESSAGE; case HAL_SERIAL_PORT_NOT_FOUND: return HAL_SERIAL_PORT_NOT_FOUND_MESSAGE; case HAL_THREAD_PRIORITY_ERROR: @@ -140,16 +122,8 @@ const char* HAL_GetErrorMessage(int32_t code) { return HAL_CAN_TIMEOUT_MESSAGE; case HAL_CAN_BUFFER_OVERRUN: return HAL_CAN_BUFFER_OVERRUN_MESSAGE; - case HAL_LED_CHANNEL_ERROR: - return HAL_LED_CHANNEL_ERROR_MESSAGE; - case HAL_INVALID_DMA_STATE: - return HAL_INVALID_DMA_STATE_MESSAGE; - case HAL_INVALID_DMA_ADDITION: - return HAL_INVALID_DMA_ADDITION_MESSAGE; case HAL_USE_LAST_ERROR: return HAL_USE_LAST_ERROR_MESSAGE; - case HAL_CONSOLE_OUT_ENABLED_ERROR: - return HAL_CONSOLE_OUT_ENABLED_ERROR_MESSAGE; default: return "Unknown error status"; } diff --git a/wpilibc/src/main/native/include/wpi/system/WPIErrors.mac b/wpilibc/src/main/native/include/wpi/system/WPIErrors.mac index 6105677a0f..c23bb93c1b 100644 --- a/wpilibc/src/main/native/include/wpi/system/WPIErrors.mac +++ b/wpilibc/src/main/native/include/wpi/system/WPIErrors.mac @@ -2,58 +2,13 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -S(ModuleIndexOutOfRange, -1, - "Allocating module that is out of range or not found") S(ChannelIndexOutOfRange, -45, "Allocating channel that is out of range") -S(NotAllocated, -2, "Attempting to free unallocated resource") S(ResourceAlreadyAllocated, -3, "Attempted to reuse an allocated resource") -S(NoAvailableResources, -4, "No available resources to allocate") S(NullParameter, -5, "A pointer parameter to a method is nullptr") S(Timeout, -6, "A timeout has been exceeded") -S(CompassManufacturerError, -7, "Compass manufacturer doesn't match HiTechnic") -S(CompassTypeError, -8, - "Compass type doesn't match expected type for HiTechnic compass") -S(IncompatibleMode, -9, "The object is in an incompatible mode") -S(AnalogTriggerLimitOrderError, -10, - "AnalogTrigger limits error. Lower limit > Upper Limit") -S(AnalogTriggerPulseOutputError, -11, - "Attempted to read AnalogTrigger pulse output") -S(TaskError, -12, "Task can't be started") -S(TaskIDError, -13, "Task error: Invalid ID") -S(TaskDeletedError, -14, "Task error: Task already deleted") -S(TaskOptionsError, -15, "Task error: Invalid options") -S(TaskMemoryError, -16, "Task can't be started due to insufficient memory") -S(TaskPriorityError, -17, "Task error: Invalid priority [1-255]") -S(DriveUninitialized, -18, "RobotDrive not initialized for the C interface") -S(CompressorNonMatching, -19, - "Compressor slot/channel doesn't match previous instance") -S(CompressorAlreadyDefined, -20, "Creating a second compressor instance") -S(CompressorUndefined, -21, - "Using compressor functions without defining compressor") -S(InconsistentArrayValueAdded, -22, - "When packing data into an array to the dashboard, not all values added were " - "of the same type") -S(MismatchedComplexTypeClose, -23, - "When packing data to the dashboard, a Close for a complex type was called " - "without a matching Open") -S(DashboardDataOverflow, -24, - "When packing data to the dashboard, too much data was packed and the buffer " - "overflowed") -S(DashboardDataCollision, -25, - "The same buffer was used for packing data and for printing") -S(EnhancedIOMissing, -26, "IO is not attached or Enhanced IO is not enabled") -S(LineNotOutput, -27, - "Cannot SetDigitalOutput for a line not configured for output") S(ParameterOutOfRange, -28, "A parameter is out of range") -S(SPIClockRateTooLow, -29, "SPI clock rate was below the minimum supported") -S(NetworkTablesReadError, -40, "Error reading NetworkTables socket") -S(NetworkTablesBufferFull, -41, "Buffer full writing to NetworkTables socket") -S(NetworkTablesWrongType, -42, - "The wrong type was read from the NetworkTables entry") -S(NetworkTablesCorrupt, -43, "NetworkTables data stream is corrupt") S(SmartDashboardMissingKey, -44, "SmartDashboard data does not exist") S(CommandIllegalUse, -50, "Illegal use of Command") -S(UnsupportedInSimulation, -80, "Unsupported in simulation") S(CameraServerError, -90, "CameraServer error") S(InvalidParameter, -100, "Invalid parameter value") S(AssertionFailure, -110, "Assertion failed") diff --git a/wpilibc/src/main/native/include/wpi/system/WPIWarnings.mac b/wpilibc/src/main/native/include/wpi/system/WPIWarnings.mac index 6ac2c11d2c..055ce8ded9 100644 --- a/wpilibc/src/main/native/include/wpi/system/WPIWarnings.mac +++ b/wpilibc/src/main/native/include/wpi/system/WPIWarnings.mac @@ -2,23 +2,6 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -S(SampleRateTooHigh, 1, "Analog module sample rate is too high") -S(VoltageOutOfRange, 2, - "Voltage to convert to raw value is out of range [-10; 10]") -S(CompressorTaskError, 3, "Compressor task won't start") -S(LoopTimingError, 4, "Digital module loop timing is not the expected value") -S(NonBinaryDigitalValue, 5, "Digital output value is not 0 or 1") -S(IncorrectBatteryChannel, 6, - "Battery measurement channel is not correct value") S(BadJoystickIndex, 7, "Joystick index is out of range, should be 0-5") S(BadJoystickAxis, 8, "Joystick axis or POV is out of range") -S(InvalidMotorIndex, 9, "Motor index is out of range, should be 0-3") -S(DriverStationTaskError, 10, "Driver Station task won't start") -S(EnhancedIOPWMPeriodOutOfRange, 11, - "Driver Station Enhanced IO PWM Output period out of range") -S(SPIWriteNoMOSI, 12, "Cannot write to SPI port with no MOSI output") -S(SPIReadNoMISO, 13, "Cannot read from SPI port with no MISO input") -S(SPIReadNoData, 14, "No data available to read from SPI") -S(IncompatibleState, 15, - "Incompatible State: The operation cannot be completed") S(Warning, 16, "Warning")