mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Merge "Updated the HAL, wpilibj, and wpilibc for PCM and PDP"
This commit is contained in:
@@ -47,7 +47,7 @@ public class PowerDistributionPanel extends SensorBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The current of one of the PDP channels (channels 1-16) in Amperes
|
||||
* @return The current of one of the PDP channels (channels 0-15) in Amperes
|
||||
*/
|
||||
public double getCurrent(int channel) {
|
||||
ByteBuffer status = ByteBuffer.allocateDirect(4);
|
||||
|
||||
@@ -69,7 +69,7 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
|
||||
private static int m_defaultAnalogModule = 1;
|
||||
private static int m_defaultDigitalModule = 1;
|
||||
private static int m_defaultSolenoidModule = 1;
|
||||
private static int m_defaultSolenoidModule = 0;
|
||||
|
||||
/**
|
||||
* Creates an instance of the sensor base and gets an FPGA handle
|
||||
@@ -242,7 +242,7 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
* @param channel The channel number to check.
|
||||
*/
|
||||
protected static void checkSolenoidChannel(final int channel) {
|
||||
if (channel <= 0 || channel > kSolenoidChannels) {
|
||||
if (channel < 0 || channel >= kSolenoidChannels) {
|
||||
System.err.println("Requested solenoid channel number is out of range.");
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
* @param channel The channel number to check.
|
||||
*/
|
||||
protected static void checkPDPChannel(final int channel) {
|
||||
if (channel <= 0 || channel > kPDPChannels) {
|
||||
if (channel < 0 || channel >= kPDPChannels) {
|
||||
System.err.println("Requested solenoid channel number is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Solenoid extends SolenoidBase implements LiveWindowSendable {
|
||||
HALUtil.checkStatus(status.asIntBuffer());
|
||||
|
||||
LiveWindow.addActuator("Solenoid", m_moduleNumber, m_channel, this);
|
||||
UsageReporting.report(tResourceType.kResourceType_Solenoid, m_channel, m_moduleNumber - 1);
|
||||
UsageReporting.report(tResourceType.kResourceType_Solenoid, m_channel, m_moduleNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract class SolenoidBase extends SensorBase implements IDeviceControll
|
||||
* @param moduleNumber The number of the solenoid module to use.
|
||||
*/
|
||||
public SolenoidBase(final int moduleNumber) {
|
||||
// m_moduleNumber = moduleNumber;
|
||||
m_moduleNumber = moduleNumber;
|
||||
// m_ports = new ByteBuffer[SensorBase.kSolenoidChannels];
|
||||
// for (int i = 0; i < SensorBase.kSolenoidChannels; i++) {
|
||||
// ByteBuffer port = SolenoidJNI.getPortWithModule((byte) moduleNumber, (byte) (i+1));
|
||||
|
||||
Reference in New Issue
Block a user