001/*----------------------------------------------------------------------------*/ 002/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */ 003/* Open Source Software - may be modified and shared by FRC teams. The code */ 004/* must be accompanied by the FIRST BSD license file in the root directory of */ 005/* the project. */ 006/*----------------------------------------------------------------------------*/ 007 008package edu.wpi.first.wpilibj; 009 010import edu.wpi.first.wpilibj.hal.HALUtil; 011 012/** 013 * Contains global utility functions. 014 * @deprecated Use RobotController class instead 015 */ 016@Deprecated 017public final class Utility { 018 private Utility() { 019 } 020 021 /** 022 * Return the FPGA Version number. For now, expect this to be 2009. 023 * 024 * @return FPGA Version number. 025 * @deprecated Use RobotController.getFPGAVersion() 026 */ 027 @SuppressWarnings("AbbreviationAsWordInName") 028 @Deprecated 029 int getFPGAVersion() { 030 return HALUtil.getFPGAVersion(); 031 } 032 033 /** 034 * Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most 035 * significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least 036 * significant bits are the Build Number. 037 * 038 * @return FPGA Revision number. 039 * @deprecated Use RobotController.getFPGARevision() 040 */ 041 @SuppressWarnings("AbbreviationAsWordInName") 042 @Deprecated 043 long getFPGARevision() { 044 return (long) HALUtil.getFPGARevision(); 045 } 046 047 /** 048 * Read the microsecond timer from the FPGA. 049 * 050 * @return The current time in microseconds according to the FPGA. 051 * @deprecated Use RobotController.getFPGATime() 052 */ 053 @Deprecated 054 @SuppressWarnings("AbbreviationAsWordInName") 055 public static long getFPGATime() { 056 return HALUtil.getFPGATime(); 057 } 058 059 /** 060 * Get the state of the "USER" button on the roboRIO. 061 * 062 * @return true if the button is currently pressed down 063 * @deprecated Use RobotController.getUserButton() 064 */ 065 @Deprecated 066 public static boolean getUserButton() { 067 return HALUtil.getFPGAButton(); 068 } 069}