2013-12-15 18:30:16 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2018-01-02 09:20:21 -08:00
|
|
|
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
|
2013-12-15 18:30:16 -05:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
2016-01-02 03:02:34 -08:00
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
2013-12-15 18:30:16 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "frc/SolenoidBase.h"
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include <hal/HAL.h>
|
|
|
|
|
#include <hal/Solenoid.h>
|
2016-05-25 22:38:11 -07:00
|
|
|
|
2016-11-01 22:33:12 -07:00
|
|
|
using namespace frc;
|
|
|
|
|
|
2017-05-08 21:55:11 -07:00
|
|
|
int SolenoidBase::GetAll(int module) {
|
2016-09-06 00:01:45 -07:00
|
|
|
int value = 0;
|
2015-06-25 15:07:55 -04:00
|
|
|
int32_t status = 0;
|
2017-05-08 21:55:11 -07:00
|
|
|
value = HAL_GetAllSolenoids(module, &status);
|
|
|
|
|
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
|
2015-06-25 15:07:55 -04:00
|
|
|
return value;
|
2013-12-15 18:30:16 -05:00
|
|
|
}
|
2016-05-20 17:30:37 -07:00
|
|
|
|
2017-05-08 21:55:11 -07:00
|
|
|
int SolenoidBase::GetAll() const {
|
|
|
|
|
return SolenoidBase::GetAll(m_moduleNumber);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SolenoidBase::GetPCMSolenoidBlackList(int module) {
|
2015-06-25 15:07:55 -04:00
|
|
|
int32_t status = 0;
|
2017-05-08 21:55:11 -07:00
|
|
|
return HAL_GetPCMSolenoidBlackList(module, &status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SolenoidBase::GetPCMSolenoidBlackList() const {
|
|
|
|
|
return SolenoidBase::GetPCMSolenoidBlackList(m_moduleNumber);
|
2014-12-26 19:40:39 -05:00
|
|
|
}
|
2016-05-20 17:30:37 -07:00
|
|
|
|
2017-05-08 21:55:11 -07:00
|
|
|
bool SolenoidBase::GetPCMSolenoidVoltageStickyFault(int module) {
|
2015-06-25 15:07:55 -04:00
|
|
|
int32_t status = 0;
|
2017-05-08 21:55:11 -07:00
|
|
|
return HAL_GetPCMSolenoidVoltageStickyFault(module, &status);
|
2014-12-26 19:40:39 -05:00
|
|
|
}
|
2016-05-20 17:30:37 -07:00
|
|
|
|
2017-05-08 21:55:11 -07:00
|
|
|
bool SolenoidBase::GetPCMSolenoidVoltageStickyFault() const {
|
|
|
|
|
return SolenoidBase::GetPCMSolenoidVoltageStickyFault(m_moduleNumber);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SolenoidBase::GetPCMSolenoidVoltageFault(int module) {
|
2015-06-25 15:07:55 -04:00
|
|
|
int32_t status = 0;
|
2017-05-08 21:55:11 -07:00
|
|
|
return HAL_GetPCMSolenoidVoltageFault(module, &status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SolenoidBase::GetPCMSolenoidVoltageFault() const {
|
|
|
|
|
return SolenoidBase::GetPCMSolenoidVoltageFault(m_moduleNumber);
|
2014-12-26 19:40:39 -05:00
|
|
|
}
|
2016-05-20 17:30:37 -07:00
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
void SolenoidBase::ClearAllPCMStickyFaults(int module) {
|
|
|
|
|
int32_t status = 0;
|
2017-05-08 21:55:11 -07:00
|
|
|
return HAL_ClearAllPCMStickyFaults(module, &status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SolenoidBase::ClearAllPCMStickyFaults() {
|
|
|
|
|
SolenoidBase::ClearAllPCMStickyFaults(m_moduleNumber);
|
2014-12-26 19:40:39 -05:00
|
|
|
}
|
2018-05-31 20:47:15 -07:00
|
|
|
|
|
|
|
|
SolenoidBase::SolenoidBase(int moduleNumber) : m_moduleNumber(moduleNumber) {}
|