Added support for digital and analog IO pins on the MXP

Change-Id: I3a4e14ceab885d19a615d6cd45f22a2250ad2856
This commit is contained in:
thomasclark
2014-06-12 09:08:33 -04:00
parent 85d9ead4e2
commit 29c4534c58
11 changed files with 247 additions and 74 deletions

View File

@@ -31,7 +31,7 @@ void AnalogChannel::InitChannel(uint8_t moduleNumber, uint32_t channel)
wpi_setWPIErrorWithContext(ModuleIndexOutOfRange, buf);
return;
}
if (!checkAnalogChannel(channel))
if (!checkAnalogInputChannel(channel))
{
snprintf(buf, 64, "Analog Channel %d", channel);
wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, buf);
@@ -49,7 +49,7 @@ void AnalogChannel::InitChannel(uint8_t moduleNumber, uint32_t channel)
void* port = getPortWithModule(moduleNumber, channel);
int32_t status = 0;
m_port = initializeAnalogPort(port, &status);
m_port = initializeAnalogInputPort(port, &status);
wpi_setErrorWithContext(status, getHALErrorMessage(status));
LiveWindow::GetInstance()->AddSensor("AnalogChannel",channel, GetModuleNumber(), this);