001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal;
006
007@SuppressWarnings("MemberName")
008public class REVPHStickyFaults {
009  public final boolean CompressorOverCurrent;
010
011  public final boolean CompressorOpen;
012
013  public final boolean SolenoidOverCurrent;
014
015  public final boolean Brownout;
016
017  public final boolean CanWarning;
018
019  public final boolean CanBusOff;
020
021  public final boolean HasReset;
022
023  /**
024   * Called from HAL.
025   *
026   * @param faults sticky fault bit mask
027   */
028  public REVPHStickyFaults(int faults) {
029    CompressorOverCurrent = (faults & 0x1) != 0;
030    CompressorOpen = (faults & 0x2) != 0;
031    SolenoidOverCurrent = (faults & 0x4) != 0;
032    Brownout = (faults & 0x8) != 0;
033    CanWarning = (faults & 0x10) != 0;
034    CanBusOff = (faults & 0x20) != 0;
035    HasReset = (faults & 0x40) != 0;
036  }
037}