mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Fixed C++ side of artf2604 in FRCSim - synchronized C++ codebases, updated examples.
Change-Id: I2fdc9deb4c8e249448dcbda4214fd900c2bc4ea8
This commit is contained in:
@@ -25,7 +25,7 @@ void AnalogInput::InitAnalogInput(uint32_t channel)
|
||||
char buf[64];
|
||||
Resource::CreateResourceObject(&inputs, kAnalogInputs);
|
||||
|
||||
if (!checkAnalogInputChannel(channel))
|
||||
if (!checkAnalogInputChannel(channel))
|
||||
{
|
||||
snprintf(buf, 64, "analog input %d", channel);
|
||||
wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, buf);
|
||||
@@ -39,14 +39,14 @@ void AnalogInput::InitAnalogInput(uint32_t channel)
|
||||
return;
|
||||
}
|
||||
|
||||
m_channel = channel;
|
||||
m_channel = channel;
|
||||
|
||||
void* port = getPort(channel);
|
||||
int32_t status = 0;
|
||||
m_port = initializeAnalogInputPort(port, &status);
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
|
||||
LiveWindow::GetInstance()->AddSensor("AnalogInput",channel, this);
|
||||
LiveWindow::GetInstance()->AddSensor("AnalogInput", channel, this);
|
||||
HALReport(HALUsageReporting::kResourceType_AnalogChannel, channel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user