mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fixed current and potential bugs caught by Coverity
Change-Id: I9f9d09dc797ffea062eeb49c881be1d5acb63d7b
This commit is contained in:
committed by
Peter Johnson
parent
b0fec4089b
commit
055ee09825
@@ -10,6 +10,7 @@
|
||||
#include "Timer.h"
|
||||
#include "WPIErrors.h"
|
||||
#include "LiveWindow/LiveWindow.h"
|
||||
#include "HAL/Port.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -43,10 +44,11 @@ AnalogInput::AnalogInput(uint32_t channel) {
|
||||
|
||||
m_channel = channel;
|
||||
|
||||
void *port = getPort(channel);
|
||||
void* port = getPort(channel);
|
||||
int32_t status = 0;
|
||||
m_port = initializeAnalogInputPort(port, &status);
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
freePort(port);
|
||||
|
||||
LiveWindow::GetInstance()->AddSensor("AnalogInput", channel, this);
|
||||
HALReport(HALUsageReporting::kResourceType_AnalogChannel, channel);
|
||||
|
||||
Reference in New Issue
Block a user