Updated the HAL, wpilibj, and wpilibc for PCM and PDP

Removed #if 0...#endif from PCM.cpp

Change-Id: I2d117c87a3fa10bddebf83706f79c2e767d22a0d

Update the HAL to the PCM/PDP changes

Change-Id: If554b650e263f174e90864f1e9ffba91daf20f7e

Update C++ to the PCM/PDP changes

Change-Id: Ia3114d4526be1dc5cc2f74fd8f7ab44f204d15f2

Updated PCM/PDP in Java

Change-Id: I8fe03afbcb1739d555e86abc0eaae1e12313d490
This commit is contained in:
thomasclark
2014-07-02 15:15:56 -04:00
parent 0ef5c3adfa
commit 255a3a5b12
17 changed files with 42 additions and 50 deletions

View File

@@ -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);

View File

@@ -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.");
}
}

View File

@@ -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);
}
/**

View File

@@ -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));